GNU Prolog for Java

gnu.prolog.term
Class IntegerTerm

java.lang.Object
  extended by gnu.prolog.term.Term
      extended by gnu.prolog.term.AtomicTerm
          extended by gnu.prolog.term.NumericTerm
              extended by gnu.prolog.term.IntegerTerm
All Implemented Interfaces:
Serializable, Cloneable

public class IntegerTerm
extends NumericTerm

32bit Integer term.

Version:
0.0.1
Author:
Constantine Plotnikov
See Also:
Serialized Form

Field Summary
protected static IntegerTerm[] cache
           
static IntegerTerm int_0
          0 integer term
static IntegerTerm int_1
          1 integer term
static IntegerTerm int_2
          2 integer term
static IntegerTerm int_3
          3 integer term
static IntegerTerm int_4
          4 integer term
static IntegerTerm int_m1
          -1 integer term
static IntegerTerm int_m2
          -2 integer term
 int value
          value of integer
 
Fields inherited from class gnu.prolog.term.Term
ATOM, COMPOUND, FLOAT, INTEGER, JAVA_OBJECT, UNKNOWN, VARIABLE
 
Constructor Summary
IntegerTerm(int val)
          a constructor
IntegerTerm(String str)
          get integer term using string value
 
Method Summary
static IntegerTerm get(int val)
          get integer term equal to val
static IntegerTerm get(String str)
          get integer term using string value
 int getTermType()
          get type of term
protected static int parseInt(String str)
           
 
Methods inherited from class gnu.prolog.term.AtomicTerm
clone, clone
 
Methods inherited from class gnu.prolog.term.Term
dereference, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cache

protected static IntegerTerm[] cache

int_m2

public static final IntegerTerm int_m2
-2 integer term


int_m1

public static final IntegerTerm int_m1
-1 integer term


int_0

public static final IntegerTerm int_0
0 integer term


int_1

public static final IntegerTerm int_1
1 integer term


int_2

public static final IntegerTerm int_2
2 integer term


int_3

public static final IntegerTerm int_3
3 integer term


int_4

public static final IntegerTerm int_4
4 integer term


value

public final int value
value of integer

Constructor Detail

IntegerTerm

public IntegerTerm(String str)
get integer term using string value

Parameters:
str - value of integer term
Throws:
IllegalArgumentException - when val could ne be converted to integer

IntegerTerm

public IntegerTerm(int val)
a constructor

Parameters:
val - value of term
Method Detail

get

public static IntegerTerm get(int val)
get integer term equal to val

Parameters:
val - value of integer term
Returns:
new integer term

parseInt

protected static int parseInt(String str)

get

public static IntegerTerm get(String str)
get integer term using string value

Parameters:
str - value of integer term
Returns:
new integer term
Throws:
IllegalArgumentException - when val could not be converted to integer

getTermType

public int getTermType()
get type of term

Overrides:
getTermType in class Term
Returns:
type of term

GNU Prolog for Java