kodkod.engine.bool
Class ITEGate

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

public final class ITEGate
extends BooleanFormula

An if-then-else gate.

Author:
Emina Torlak
invariant:
inputs = 0->ifFormula + 1->thenFormula + 2->elseFormula
this.label > 0
this.op = Operator.ITE
specfield:
ifFormula: BooleanFormula
thenFormula: BooleanFormula
elseFormula: BooleanFormula
all input: inputs | this.label > |input.label|

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 the hashcode for this if-then-else gate.
 BooleanFormula input(int i)
          Returns this.inputs[i].
 java.util.Iterator<BooleanFormula> iterator()
          Returns an iterator over this.inputs
 int label()
          Returns this.label
 Operator op()
          Returns Operator.ITE.
 int size()
          Returns 3.
 java.lang.String toString()
          Returns a string representation of this ITE gate.
 
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

iterator

public java.util.Iterator<BooleanFormula> iterator()
Returns an iterator over this.inputs

Specified by:
iterator in interface java.lang.Iterable<BooleanFormula>
Specified by:
iterator in class BooleanFormula
Returns:
returns an iterator over this.inputs
See Also:
BooleanFormula.iterator()

size

public int size()
Returns 3.

Specified by:
size in class BooleanFormula
Returns:
2
See Also:
BooleanFormula.size()

label

public int label()
Returns this.label

Specified by:
label in class BooleanValue
Returns:
this.label
See Also:
BooleanValue.label()

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.
See Also:
BooleanFormula.accept(kodkod.engine.bool.BooleanVisitor, Object)

toString

public java.lang.String toString()
Returns a string representation of this ITE gate.

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

hashCode

public int hashCode()
Returns the hashcode for this if-then-else gate.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode for this gate.

op

public Operator op()
Returns Operator.ITE.

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

input

public BooleanFormula input(int i)
Returns this.inputs[i].

Specified by:
input in class BooleanFormula
Returns:
this.inputs[i]
Throws:
java.lang.IndexOutOfBoundsException - - 0 < i || i > 2