org.jscience.mathematics.algebraic.numbers
Class Boolean

java.lang.Object
  extended by java.lang.Number
      extended by org.jscience.mathematics.algebraic.numbers.ComparableNumber<Boolean>
          extended by org.jscience.mathematics.algebraic.numbers.Boolean
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Boolean>, BooleanAlgebra.Member, JoinSemiLattice.Member, Lattice.Member, MeetSemiLattice.Member, Member

public final class Boolean
extends ComparableNumber<Boolean>
implements java.lang.Cloneable, java.io.Serializable, BooleanAlgebra.Member

The Boolean class encapsulates Boolean numbers.

See Also:
Lattice, Serialized Form

Field Summary
static Boolean FALSE
          DOCUMENT ME!
static Boolean NaN
          DOCUMENT ME!
static Boolean NEGATIVE_INFINITY
          DOCUMENT ME!
static Boolean POSITIVE_INFINITY
          DOCUMENT ME!
static Boolean TRUE
          DOCUMENT ME!
static java.lang.Class TYPE
          DOCUMENT ME!
 
Constructor Summary
Boolean(boolean num)
          Constructs a boolean number.
Boolean(Boolean num)
          Constructs a boolean number.
Boolean(java.lang.String s)
          Constructs the boolean number represented by a string.
 
Method Summary
 Boolean and(Boolean n)
          Returns the conjunction of this boolean number and another.
 java.lang.Object clone()
          DOCUMENT ME!
 int compareTo(Boolean that)
          DOCUMENT ME!
 int compareTo(ComparableNumber obj)
          Compares two boolean numbers.
 BooleanAlgebra.Member complement()
          Returns the negation of this number.
 double doubleValue()
          DOCUMENT ME!
 boolean equals(java.lang.Object obj)
          Compares two boolean numbers for equality.
 float floatValue()
          DOCUMENT ME!
 Boolean getDistance(ComparableNumber n)
          Returns FALSE if the values are equal, TRUE otherwise
 Boolean getNaN()
          DOCUMENT ME!
 Boolean getNegativeInfinity()
          DOCUMENT ME!
 Boolean getPositiveInfinity()
          DOCUMENT ME!
 int hashCode()
          Returns a hash code for this Boolean object.
 int intValue()
          DOCUMENT ME!
 boolean isInfinite()
          DOCUMENT ME!
 boolean isNaN()
          DOCUMENT ME!
 boolean isNegativeInfinity()
          DOCUMENT ME!
 boolean isPositiveInfinity()
          DOCUMENT ME!
 Boolean join(Boolean n)
          Returns the disjunction of this boolean number and another.
 Lattice.Member join(JoinSemiLattice.Member n)
          Returns the disjunction of this number and another.
 long longValue()
          DOCUMENT ME!
 Boolean max(Boolean val)
          Returns the max of this number and another, according to compareTo rules.
 Boolean meet(Boolean n)
          Returns the conjunction of this boolean number and another.
 Lattice.Member meet(MeetSemiLattice.Member n)
          Returns the conjunction of this number and another.
 Boolean min(Boolean val)
          Returns the min of this number and another, according to compareTo rules.
 Boolean not()
          Returns the negation of this number.
 Boolean or(Boolean n)
          Returns the disjunction of this boolean number and another.
 java.lang.String toString()
          Returns a string representing the value of this boolean number.
 boolean value()
          Returns the integer value.
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FALSE

public static final Boolean FALSE
DOCUMENT ME!


TRUE

public static final Boolean TRUE
DOCUMENT ME!


NEGATIVE_INFINITY

public static final Boolean NEGATIVE_INFINITY
DOCUMENT ME!


POSITIVE_INFINITY

public static final Boolean POSITIVE_INFINITY
DOCUMENT ME!


NaN

public static final Boolean NaN
DOCUMENT ME!


TYPE

public static final java.lang.Class TYPE
DOCUMENT ME!

Constructor Detail

Boolean

public Boolean(boolean num)
Constructs a boolean number.


Boolean

public Boolean(Boolean num)
Constructs a boolean number.


Boolean

public Boolean(java.lang.String s)
        throws java.lang.NumberFormatException
Constructs the boolean number represented by a string.

Parameters:
s - a string representing an integer number.
Throws:
java.lang.NumberFormatException - if the string does not contain a parsable number.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares two boolean numbers for equality.

Overrides:
equals in class java.lang.Object
Parameters:
obj - a boolean number.
Returns:
DOCUMENT ME!

compareTo

public int compareTo(ComparableNumber obj)
              throws java.lang.IllegalArgumentException
Compares two boolean numbers.

Parameters:
obj - an boolean number.
Returns:
a negative value if this<obj, zero if this==obj, and a positive value if this>obj.
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

toString

public java.lang.String toString()
Returns a string representing the value of this boolean number.

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

value

public boolean value()
Returns the integer value.

Returns:
DOCUMENT ME!

intValue

public int intValue()
DOCUMENT ME!

Specified by:
intValue in class java.lang.Number
Returns:
DOCUMENT ME!

longValue

public long longValue()
DOCUMENT ME!

Specified by:
longValue in class java.lang.Number
Returns:
DOCUMENT ME!

floatValue

public float floatValue()
DOCUMENT ME!

Specified by:
floatValue in class java.lang.Number
Returns:
DOCUMENT ME!

doubleValue

public double doubleValue()
DOCUMENT ME!

Specified by:
doubleValue in class java.lang.Number
Returns:
DOCUMENT ME!

min

public Boolean min(Boolean val)
Returns the min of this number and another, according to compareTo rules.

Overrides:
min in class ComparableNumber<Boolean>
Parameters:
val - DOCUMENT ME!
Returns:
DOCUMENT ME!

max

public Boolean max(Boolean val)
Returns the max of this number and another, according to compareTo rules.

Overrides:
max in class ComparableNumber<Boolean>
Parameters:
val - DOCUMENT ME!
Returns:
DOCUMENT ME!

hashCode

public int hashCode()
Returns a hash code for this Boolean object.

Overrides:
hashCode in class java.lang.Object
Returns:
DOCUMENT ME!

getDistance

public Boolean getDistance(ComparableNumber n)
Returns FALSE if the values are equal, TRUE otherwise

Specified by:
getDistance in class ComparableNumber<Boolean>
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

isNaN

public boolean isNaN()
DOCUMENT ME!

Specified by:
isNaN in class ComparableNumber<Boolean>
Returns:
DOCUMENT ME!

isInfinite

public boolean isInfinite()
DOCUMENT ME!

Specified by:
isInfinite in class ComparableNumber<Boolean>
Returns:
DOCUMENT ME!

isNegativeInfinity

public boolean isNegativeInfinity()
DOCUMENT ME!

Specified by:
isNegativeInfinity in class ComparableNumber<Boolean>
Returns:
DOCUMENT ME!

isPositiveInfinity

public boolean isPositiveInfinity()
DOCUMENT ME!

Specified by:
isPositiveInfinity in class ComparableNumber<Boolean>
Returns:
DOCUMENT ME!

getNaN

public Boolean getNaN()
DOCUMENT ME!

Specified by:
getNaN in class ComparableNumber<Boolean>
Returns:
DOCUMENT ME!

getNegativeInfinity

public Boolean getNegativeInfinity()
DOCUMENT ME!

Specified by:
getNegativeInfinity in class ComparableNumber<Boolean>
Returns:
DOCUMENT ME!

getPositiveInfinity

public Boolean getPositiveInfinity()
DOCUMENT ME!

Specified by:
getPositiveInfinity in class ComparableNumber<Boolean>
Returns:
DOCUMENT ME!

compareTo

public int compareTo(Boolean that)
DOCUMENT ME!

Specified by:
compareTo in interface java.lang.Comparable<Boolean>
Parameters:
that - DOCUMENT ME!
Returns:
DOCUMENT ME!

complement

public BooleanAlgebra.Member complement()
Returns the negation of this number.

Specified by:
complement in interface BooleanAlgebra.Member
Returns:
DOCUMENT ME!

not

public Boolean not()
Returns the negation of this number.

Returns:
DOCUMENT ME!

join

public Lattice.Member join(JoinSemiLattice.Member n)
Returns the disjunction of this number and another.

Specified by:
join in interface JoinSemiLattice.Member
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

join

public Boolean join(Boolean n)
Returns the disjunction of this boolean number and another.

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

or

public Boolean or(Boolean n)
Returns the disjunction of this boolean number and another.

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

meet

public Lattice.Member meet(MeetSemiLattice.Member n)
Returns the conjunction of this number and another.

Specified by:
meet in interface MeetSemiLattice.Member
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

meet

public Boolean meet(Boolean n)
Returns the conjunction of this boolean number and another.

Parameters:
n - an boolean number.
Returns:
DOCUMENT ME!

and

public Boolean and(Boolean n)
Returns the conjunction of this boolean number and another.

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

clone

public java.lang.Object clone()
DOCUMENT ME!

Overrides:
clone in class java.lang.Object
Returns:
DOCUMENT ME!