ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

escjava.prover
Class SInt

java.lang.Object
  extended byescjava.prover.SExp
      extended byescjava.prover.SInt

public final class SInt
extends SExp

Design:
unknown author - The "public" below was added so that stuff in the sexpgrep package can know about SInt (for the conversion between the two kinds of s-expressions).

Field Summary
private  int value
          The int we represent.
 
Constructor Summary
private SInt(int i)
          Create a SInt representing a given int.
 
Method Summary
 boolean equals(java.lang.Object o)
           
(package private) static SInt fromInt(int i)
          Create a SInt representing a given int.
 int getInteger()
          If we represent an integer, return it as an int; otherwise, throw SExpTypeError.
 boolean isInteger()
           
 void prettyPrint(java.io.PrintStream out)
          Pretty-print a textual representation of us on a given PrintStream.
 void print(java.io.PrintStream out)
          Print a textual representation of us on a given PrintStream.
 
Methods inherited from class escjava.prover.SExp
display, fancyMake, getAtom, getList, isAtom, isList, main, make, print, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

private int value
The int we represent.

Constructor Detail

SInt

private SInt(int i)
Create a SInt representing a given int. Clients are allowed to create SInts only by calling fromInt so we can choose later to intern if we wish.

Method Detail

fromInt

static SInt fromInt(int i)
Create a SInt representing a given int.


isInteger

public boolean isInteger()
Overrides:
isInteger in class SExp
Returns:
a flag indicating if we represent an integer, which is always true.

getInteger

public int getInteger()
If we represent an integer, return it as an int; otherwise, throw SExpTypeError.

Overrides:
getInteger in class SExp

equals

public boolean equals(java.lang.Object o)
Returns:
true iff parameter o is an SInt with the same value as this.

print

public void print(java.io.PrintStream out)
Print a textual representation of us on a given PrintStream.

Note: This routine will take a PrintWriter instead when we switch to a more recent version of JDK.

Specified by:
print in class SExp

prettyPrint

public void prettyPrint(java.io.PrintStream out)
Pretty-print a textual representation of us on a given PrintStream.

Note: This routine will take a PrintWriter instead when we switch to a more recent version of JDK.

Specified by:
prettyPrint in class SExp

ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

The ESC/Java2 Project Homepage