Method from java.lang.Boolean Detail: |
public boolean booleanValue() {
return value;
}
Returns the value of this {@code Boolean} object as a boolean
primitive. |
public static int compare(boolean x,
boolean y) {
return (x == y) ? 0 : (x ? 1 : -1);
}
Compares two {@code boolean} values.
The value returned is identical to what would be returned by:
Boolean.valueOf(x).compareTo(Boolean.valueOf(y))
|
public int compareTo(Boolean b) {
return compare(this.value, b.value);
}
Compares this {@code Boolean} instance with another. |
public boolean equals(Object obj) {
if (obj instanceof Boolean) {
return value == ((Boolean)obj).booleanValue();
}
return false;
}
Returns {@code true} if and only if the argument is not
{@code null} and is a {@code Boolean} object that
represents the same {@code boolean} value as this object. |
public static boolean getBoolean(String name) {
boolean result = false;
try {
result = toBoolean(System.getProperty(name));
} catch (IllegalArgumentException e) {
} catch (NullPointerException e) {
}
return result;
}
Returns {@code true} if and only if the system property
named by the argument exists and is equal to the string
{@code "true"}. (Beginning with version 1.0.2 of the
JavaTM platform, the test of
this string is case insensitive.) A system property is accessible
through {@code getProperty}, a method defined by the
{@code System} class.
If there is no property with the specified name, or if the specified
name is empty or null, then {@code false} is returned. |
public int hashCode() {
return value ? 1231 : 1237;
}
Returns a hash code for this {@code Boolean} object. |
public static boolean parseBoolean(String s) {
return toBoolean(s);
}
Parses the string argument as a boolean. The {@code boolean}
returned represents the value {@code true} if the string argument
is not {@code null} and is equal, ignoring case, to the string
{@code "true"}.
Example: {@code Boolean.parseBoolean("True")} returns {@code true}.
Example: {@code Boolean.parseBoolean("yes")} returns {@code false}. |
public String toString() {
return value ? "true" : "false";
}
Returns a {@code String} object representing this Boolean's
value. If this object represents the value {@code true},
a string equal to {@code "true"} is returned. Otherwise, a
string equal to {@code "false"} is returned. |
public static String toString(boolean b) {
return b ? "true" : "false";
}
Returns a {@code String} object representing the specified
boolean. If the specified boolean is {@code true}, then
the string {@code "true"} will be returned, otherwise the
string {@code "false"} will be returned. |
public static Boolean valueOf(boolean b) {
return (b ? TRUE : FALSE);
}
Returns a {@code Boolean} instance representing the specified
{@code boolean} value. If the specified {@code boolean} value
is {@code true}, this method returns {@code Boolean.TRUE};
if it is {@code false}, this method returns {@code Boolean.FALSE}.
If a new {@code Boolean} instance is not required, this method
should generally be used in preference to the constructor
#Boolean(boolean) , as this method is likely to yield
significantly better space and time performance. |
public static Boolean valueOf(String s) {
return toBoolean(s) ? TRUE : FALSE;
}
Returns a {@code Boolean} with a value represented by the
specified string. The {@code Boolean} returned represents a
true value if the string argument is not {@code null}
and is equal, ignoring case, to the string {@code "true"}. |