kodkod.ast
Class IntConstant

java.lang.Object
  extended by kodkod.ast.IntExpression
      extended by kodkod.ast.IntConstant
All Implemented Interfaces:
Node

public final class IntConstant
extends IntExpression

An integer constant (literal).

Author:
Emina Torlak
specfield:
value: int

Method Summary
<E,F,D,I> I
accept(ReturnVisitor<E,F,D,I> visitor)
          Accepts the given visitor and returns the result of the visit (i.e. the result of the call visitor.visit(this))
 void accept(VoidVisitor visitor)
          Accepts the given void visitor by calling visitor.visit(this).
static IntConstant constant(int value)
          Returns an IntConstant corresponding to the given value.
 boolean equals(java.lang.Object o)
          Return true if o is an IntConstant with the same value as this.
 int hashCode()
          Return this.value
 java.lang.String toString()
          Returns the string representation of this int constant.
 int value()
          Returns this.value.
 
Methods inherited from class kodkod.ast.IntExpression
abs, and, apply, compare, compose, divide, eq, gt, gte, lt, lte, minus, modulo, multiply, negate, not, or, plus, sha, shl, shr, signum, sum, toExpression, xor
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

constant

public static IntConstant constant(int value)
Returns an IntConstant corresponding to the given value.

Returns:
{c: IntConstant | c.value = value}

value

public int value()
Returns this.value.

Returns:
this.value

equals

public boolean equals(java.lang.Object o)
Return true if o is an IntConstant with the same value as this.

Overrides:
equals in class java.lang.Object
Returns:
o in IntConstant && o.value = this.value

hashCode

public int hashCode()
Return this.value

Overrides:
hashCode in class java.lang.Object
Returns:
this.value

toString

public java.lang.String toString()
Returns the string representation of this int constant.

Overrides:
toString in class java.lang.Object
Returns:
string representation of this int constant.

accept

public <E,F,D,I> I accept(ReturnVisitor<E,F,D,I> visitor)
Accepts the given visitor and returns the result of the visit (i.e. the result of the call visitor.visit(this))

Specified by:
accept in interface Node
Specified by:
accept in class IntExpression
Returns:
the result of being visited by the given visitor
See Also:
IntExpression.accept(kodkod.ast.visitor.ReturnVisitor)

accept

public void accept(VoidVisitor visitor)
Accepts the given void visitor by calling visitor.visit(this).

Specified by:
accept in interface Node
Specified by:
accept in class IntExpression
See Also:
IntExpression.accept(kodkod.ast.visitor.VoidVisitor)