kodkod.engine.bool
Class BooleanConstant

java.lang.Object
  extended by kodkod.engine.bool.BooleanValue
      extended by kodkod.engine.bool.BooleanConstant
All Implemented Interfaces:
java.lang.Comparable<BooleanValue>

public final class BooleanConstant
extends BooleanValue

A boolean constant, true or false. The integer label of the true and false constants are Integer.MAX_VALUE and -Integer.MAX_VALUE, respectively. The two boolean constants, TRUE and FALSE, are shared among all factories.

Author:
Emina Torlak
invariant:
this.op = Operator.CONST
value => Integer.MAX_VALUE, -Integer.MAX_VALUE
specfield:
value: boolean

Field Summary
static BooleanConstant FALSE
           
static BooleanConstant TRUE
           
 
Method Summary
 boolean booleanValue()
          Returns the primitive boolean representation of this label.
static BooleanConstant constant(boolean value)
          Returns the BooleanConstant that represents the given boolean value.
 int label()
          Returns the label for this value.
 Operator op()
          Returns Operator.CONST.
 java.lang.String toString()
          Returns a string representation of this boolean value.
 
Methods inherited from class kodkod.engine.bool.BooleanValue
compareTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static final BooleanConstant TRUE

FALSE

public static final BooleanConstant FALSE
Method Detail

booleanValue

public boolean booleanValue()
Returns the primitive boolean representation of this label.

Returns:
this.label == Integer.MAX_VALUE

constant

public static BooleanConstant constant(boolean value)
Returns the BooleanConstant that represents the given boolean value.

Returns:
{c: BooleanConstant | value => c.label = Integer.MAX_VALUE, c.label = -Integer.MAX_VALUE }

label

public int label()
Returns the label for this value.

Specified by:
label in class BooleanValue
Returns:
this.label

toString

public java.lang.String toString()
Returns a string representation of this boolean value.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this boolean value.

op

public Operator op()
Returns Operator.CONST.

Specified by:
op in class BooleanValue
Returns:
Operator.CONST