org.jscience.mathematics.algebraic.fields
Class BooleanRing

java.lang.Object
  extended by org.jscience.mathematics.algebraic.fields.BooleanRing
All Implemented Interfaces:
Ring, AbelianGroup

public final class BooleanRing
extends java.lang.Object
implements Ring

The BooleanRing class encapsulates the ring of (false,true) boolean numbers.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jscience.mathematics.algebraic.fields.Ring
Ring.Member
 
Field Summary
static ExactInteger FALSE
          DOCUMENT ME!
static ExactInteger ONE
          DOCUMENT ME!
static ExactInteger TRUE
          DOCUMENT ME!
static ExactInteger ZERO
          DOCUMENT ME!
 
Method Summary
 AbelianGroup.Member falseValue()
          Returns the boolean number zero.
static BooleanRing getInstance()
          Constructs a ring of boolean numbers.
 boolean isComplement(AbelianGroup.Member a, AbelianGroup.Member b)
          Returns true if one boolean number is the complement of the other.
 boolean isFalse(AbelianGroup.Member g)
          Returns true if the boolean number is equal to false.
 boolean isNegative(AbelianGroup.Member a, AbelianGroup.Member b)
          Returns true if one boolean number is the negative of the other.
 boolean isOne(Ring.Member r)
          Returns true if the integer number is equal to one.
 boolean isTrue(Ring.Member r)
          Returns true if the boolean number is equal to true.
 boolean isZero(AbelianGroup.Member g)
          Returns true if the boolean number is equal to zero.
 Ring.Member one()
          Returns the integer number one.
 Ring.Member trueValue()
          Returns the boolean number true.
 AbelianGroup.Member zero()
          Returns the boolean number zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO

public static final ExactInteger ZERO
DOCUMENT ME!


ONE

public static final ExactInteger ONE
DOCUMENT ME!


FALSE

public static final ExactInteger FALSE
DOCUMENT ME!


TRUE

public static final ExactInteger TRUE
DOCUMENT ME!

Method Detail

getInstance

public static final BooleanRing getInstance()
Constructs a ring of boolean numbers. Singleton.

Returns:
DOCUMENT ME!

zero

public AbelianGroup.Member zero()
Returns the boolean number zero.

Specified by:
zero in interface AbelianGroup
Returns:
DOCUMENT ME!

isZero

public boolean isZero(AbelianGroup.Member g)
Returns true if the boolean number is equal to zero.

Specified by:
isZero in interface AbelianGroup
Parameters:
g - DOCUMENT ME!
Returns:
DOCUMENT ME!

isNegative

public boolean isNegative(AbelianGroup.Member a,
                          AbelianGroup.Member b)
Returns true if one boolean number is the negative of the other.

Specified by:
isNegative in interface AbelianGroup
Parameters:
a - DOCUMENT ME!
b - DOCUMENT ME!
Returns:
DOCUMENT ME!

one

public Ring.Member one()
Returns the integer number one.

Specified by:
one in interface Ring
Returns:
DOCUMENT ME!

isOne

public boolean isOne(Ring.Member r)
Returns true if the integer number is equal to one.

Specified by:
isOne in interface Ring
Parameters:
r - DOCUMENT ME!
Returns:
DOCUMENT ME!

falseValue

public AbelianGroup.Member falseValue()
Returns the boolean number zero.

Returns:
DOCUMENT ME!

isFalse

public boolean isFalse(AbelianGroup.Member g)
Returns true if the boolean number is equal to false.

Parameters:
g - DOCUMENT ME!
Returns:
DOCUMENT ME!

isComplement

public boolean isComplement(AbelianGroup.Member a,
                            AbelianGroup.Member b)
Returns true if one boolean number is the complement of the other.

Parameters:
a - DOCUMENT ME!
b - DOCUMENT ME!
Returns:
DOCUMENT ME!

trueValue

public Ring.Member trueValue()
Returns the boolean number true.

Returns:
DOCUMENT ME!

isTrue

public boolean isTrue(Ring.Member r)
Returns true if the boolean number is equal to true.

Parameters:
r - DOCUMENT ME!
Returns:
DOCUMENT ME!