kodkod.engine.bool
Class Operator

java.lang.Object
  extended by kodkod.engine.bool.Operator
All Implemented Interfaces:
java.lang.Comparable<Operator>
Direct Known Subclasses:
Operator.Nary

public abstract class Operator
extends java.lang.Object
implements java.lang.Comparable<Operator>

Operator associated with a boolean value.

Author:
Emina Torlak
invariant:
AND.ordinal = 0 && OR.ordinal = 1 && ITE.ordinal = 2 && NOT.ordinal = 2 && VAR.ordinal = 4 && CONST.ordinal = 5
specfield:
ordinal: [0..5]

Nested Class Summary
static class Operator.Nary
          An n-ary operator, where n>=2
 
Field Summary
static Operator.Nary AND
          N-ary AND operator.
static Operator CONST
          Zero-arity constant operator.
static kodkod.engine.bool.Operator.Ternary ITE
          Ternary if-then-else operator.
static Operator NOT
          Unary negation operator.
static Operator.Nary OR
          N-ary OR operator.
static Operator VAR
          Zero-arity variable operator.
 
Method Summary
 int compareTo(Operator op)
          Returns an integer i such that i < 0 if this.ordinal < op.ordinal, i = 0 when this.ordinal = op.ordinal, and i > 0 when this.ordinal > op.ordinal.
 int ordinal()
          Returns the ordinal of this operator constant.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AND

public static final Operator.Nary AND
N-ary AND operator.


OR

public static final Operator.Nary OR
N-ary OR operator.


ITE

public static final kodkod.engine.bool.Operator.Ternary ITE
Ternary if-then-else operator.


NOT

public static final Operator NOT
Unary negation operator.


VAR

public static final Operator VAR
Zero-arity variable operator.


CONST

public static final Operator CONST
Zero-arity constant operator.

Method Detail

ordinal

public final int ordinal()
Returns the ordinal of this operator constant.

Returns:
the ordinal of this operator constant.

compareTo

public int compareTo(Operator op)
Returns an integer i such that i < 0 if this.ordinal < op.ordinal, i = 0 when this.ordinal = op.ordinal, and i > 0 when this.ordinal > op.ordinal.

Specified by:
compareTo in interface java.lang.Comparable<Operator>
Returns:
i: int | this.ordinal < op.ordinal => i < 0, this.ordinal = op.ordinal => i = 0, i > 0
Throws:
java.lang.NullPointerException - - op = null