kodkod.engine.bool
Class NotGate

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

public final class NotGate
extends BooleanFormula

A logic NOT gate.

Author:
Emina Torlak
invariant:
this.op = Operator.NOT
#inputs = 1
this.label = -inputs.label
label in (-Integer.MAX_VALUE..-1]

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 inverter.
 BooleanFormula input(int i)
          Returns this.input[i].
 java.util.Iterator<BooleanFormula> iterator()
          Returns an iterator that returns this gate's single input.
 int label()
          Returns the label for this value.
 Operator op()
          Returns Operator.NOT.
 int size()
          Returns 1.
 java.lang.String toString()
          Returns a string representation of this inverter.
 
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 that returns this gate's single input.

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

label

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

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

size

public int size()
Returns 1.

Specified by:
size in class BooleanFormula
Returns:
1.

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.

toString

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

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

op

public Operator op()
Returns Operator.NOT.

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

input

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

Specified by:
input in class BooleanFormula
Returns:
this.input[i]
Throws:
java.lang.IndexOutOfBoundsException - - i != 0

hashCode

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

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