Back to index

plt-scheme  4.2.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes
java.lang.Boolean Class Reference

Instances of class Boolean represent primitive boolean values. More...

Inheritance diagram for java.lang.Boolean:
Inheritance graph
[legend]
Collaboration diagram for java.lang.Boolean:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Boolean (boolean value)
 Create a Boolean object representing the value of the argument value.
 Boolean (String s)
 Creates a Boolean object representing the primitive true if and only if s matches the string "true" ignoring case, otherwise the object will represent the primitive false.
boolean booleanValue ()
 Return the primitive boolean value of this Boolean object.
String toString ()
 Returns "true" if the value of this object is true and returns "false" if the value of this object is false.
int hashCode ()
 Returns the integer 1231 if this object represents the primitive true and the integer 1237 otherwise.
boolean equals (Object obj)
 If the obj is an instance of Boolean and has the same primitive value as this object then true is returned.

Static Public Member Functions

static Boolean valueOf (boolean b)
 Returns the Boolean TRUE if the given boolean is true, otherwise it will return the Boolean FALSE.
static Boolean valueOf (String s)
 Returns the Boolean TRUE if and only if the given String is equal, ignoring case, to the String "true", otherwise it will return the Boolean FALSE.
static String toString (boolean b)
 Returns "true" if the value of the give boolean is true and returns "false" if the value of the given boolean is false.
static boolean getBoolean (String name)
 If the value of the system property name matches "true" ignoring case then the function returns true.

Static Public Attributes

static final Boolean TRUE = new Boolean(true)
 This field is a Boolean object representing the primitive value true.
static final Boolean FALSE = new Boolean(false)
 This field is a Boolean object representing the primitive value false.

Private Attributes

final boolean value
 The primitive type boolean is represented by this Class object.

Static Private Attributes

static final long serialVersionUID = -3665804199014368530L
 Compatible with JDK 1.0.2+.

Detailed Description

Instances of class Boolean represent primitive boolean values.

Author:
Paul Fisher
Eric Blake ebb9@.nosp@m.emai.nosp@m.l.byu.nosp@m..edu
Since:
1.0 updated to 1.4

Definition at line 52 of file Boolean.java.


Constructor & Destructor Documentation

java.lang.Boolean.Boolean ( boolean  value) [inline]

Create a Boolean object representing the value of the argument value.

In general the use of the static method valueof(boolean) is more efficient since it will not create a new object.

Parameters:
valuethe primitive value of this Boolean
See also:
valueOf(boolean)

Definition at line 98 of file Boolean.java.

  {
    this.value = value;
  }

Here is the caller graph for this function:

java.lang.Boolean.Boolean ( String  s) [inline]

Creates a Boolean object representing the primitive true if and only if s matches the string "true" ignoring case, otherwise the object will represent the primitive false.

In general the use of the static method valueof(String) is more efficient since it will not create a new object.

Parameters:
sthe String representation of true or false

Definition at line 114 of file Boolean.java.

  {
    value = "true".equalsIgnoreCase(s);
  }

Member Function Documentation

Return the primitive boolean value of this Boolean object.

Returns:
true or false, depending on the value of this Boolean

Definition at line 125 of file Boolean.java.

  {
    return value;
  }
boolean java.lang.Boolean.equals ( Object  obj) [inline]

If the obj is an instance of Boolean and has the same primitive value as this object then true is returned.

In all other cases, including if the obj is null, false is returned.

Parameters:
objpossibly an instance of any Class
Returns:
true if obj equals this

Definition at line 204 of file Boolean.java.

  {
    return obj instanceof Boolean && value == ((Boolean) obj).value;
  }

Here is the call graph for this function:

static boolean java.lang.Boolean.getBoolean ( String  name) [inline, static]

If the value of the system property name matches "true" ignoring case then the function returns true.

Parameters:
namethe property name to look up
Returns:
true if the property resulted in "true"
Exceptions:
SecurityExceptionif accessing the system property is forbidden
See also:
System::getProperty(String)

Definition at line 218 of file Boolean.java.

  {
      throw new RuntimeException("getBoolean has not been implemented yet");
//    if (name == null || "".equals(name))
//     return false;
//    return "true".equalsIgnoreCase(System.getProperty(name));
  }

Returns the integer 1231 if this object represents the primitive true and the integer 1237 otherwise.

Returns:
the hash code

Definition at line 190 of file Boolean.java.

  {
    return value ? 1231 : 1237;
  }
static String java.lang.Boolean.toString ( boolean  b) [inline, static]

Returns "true" if the value of the give boolean is true and returns "false" if the value of the given boolean is false.

Parameters:
bthe boolean to convert
Returns:
the string representation of the boolean
Since:
1.4

Definition at line 167 of file Boolean.java.

  {
    return b ? "true" : "false";
  }
String java.lang.Boolean.toString ( ) [inline]

Returns "true" if the value of this object is true and returns "false" if the value of this object is false.

Returns:
the string representation of this

Definition at line 178 of file Boolean.java.

  {
    return value ? "true" : "false";
  }
static Boolean java.lang.Boolean.valueOf ( boolean  b) [inline, static]

Returns the Boolean TRUE if the given boolean is true, otherwise it will return the Boolean FALSE.

Parameters:
bthe boolean to wrap
Returns:
the wrapper object
See also:
TRUE
FALSE
Since:
1.4

Definition at line 141 of file Boolean.java.

  {
    return b ? TRUE : FALSE;
  }
static Boolean java.lang.Boolean.valueOf ( String  s) [inline, static]

Returns the Boolean TRUE if and only if the given String is equal, ignoring case, to the String "true", otherwise it will return the Boolean FALSE.

Parameters:
sthe string to convert
Returns:
a wrapped boolean from the string

Definition at line 154 of file Boolean.java.

  {
    return "true".equalsIgnoreCase(s) ? TRUE : FALSE;
  }

Member Data Documentation

final Boolean java.lang.Boolean.FALSE = new Boolean(false) [static]

This field is a Boolean object representing the primitive value false.

This instance is returned by the static valueOf() methods if they return a Boolean representing false.

Definition at line 73 of file Boolean.java.

final long java.lang.Boolean.serialVersionUID = -3665804199014368530L [static, private]

Compatible with JDK 1.0.2+.

Definition at line 57 of file Boolean.java.

final Boolean java.lang.Boolean.TRUE = new Boolean(true) [static]

This field is a Boolean object representing the primitive value true.

This instance is returned by the static valueOf() methods if they return a Boolean representing true.

Definition at line 65 of file Boolean.java.

The primitive type boolean is represented by this Class object.

Since:
1.1 The immutable value of this Boolean. the wrapped value

Definition at line 87 of file Boolean.java.


The documentation for this class was generated from the following file: