kodkod.engine.bool
Class BooleanVariable

java.lang.Object
  extended by kodkod.engine.bool.BooleanValue
      extended by kodkod.engine.bool.BooleanFormula
          extended by kodkod.engine.bool.BooleanVariable
All Implemented Interfaces:
java.lang.Comparable<BooleanValue>, java.lang.Iterable<BooleanFormula>

public final class BooleanVariable
extends BooleanFormula

Represents a boolean variable.

Author:
Emina Torlak
invariant:
op = Operator.VAR
no inputs && label in [1, ..., Integer.MAX_VALUE)

Method Summary
<T,A> T
accept(BooleanVisitor<T,A> visitor, A arg)
          Passes this value and the given argument value to the visitor, and returns the resulting value.
 int hashCode()
          Returns a hashcode for this variable.
 BooleanFormula input(int i)
          Throws an IndexOutOfBoundsException.
 java.util.Iterator<BooleanFormula> iterator()
          Returns an empty iterator.
 int label()
          Returns the label for this value.
 Operator op()
          Returns the VAR operator.
 int size()
          Returns 0.
 java.lang.String toString()
          Returns a string representation of this variable.
 
Methods inherited from class kodkod.engine.bool.BooleanValue
compareTo
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

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 variable.

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

accept

public <T,A> T accept(BooleanVisitor<T,A> visitor,
                      A arg)
Passes this value and the given argument value to the visitor, and returns the resulting value.

Specified by:
accept in class BooleanFormula
Returns:
the value produced by the visitor when visiting this node with the given argument.

op

public Operator op()
Returns the VAR operator.

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

iterator

public java.util.Iterator<BooleanFormula> iterator()
Returns an empty iterator.

Specified by:
iterator in interface java.lang.Iterable<BooleanFormula>
Specified by:
iterator in class BooleanFormula
Returns:
an empty iterator

size

public int size()
Returns 0.

Specified by:
size in class BooleanFormula
Returns:
0

input

public BooleanFormula input(int i)
Throws an IndexOutOfBoundsException.

Specified by:
input in class BooleanFormula
Returns:
this.inputs[i]
Throws:
java.lang.IndexOutOfBoundsException

hashCode

public int hashCode()
Returns a hashcode for this variable.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode for this variable.