ua.gradsoft.termware
Class IntTerm

java.lang.Object
  extended by ua.gradsoft.termware.Term
      extended by ua.gradsoft.termware.AbstractPrimitiveTerm
          extended by ua.gradsoft.termware.IntTerm
All Implemented Interfaces:
Serializable, Cloneable

public class IntTerm
extends AbstractPrimitiveTerm

Term which represent integer value.

See Also:
Term, Serialized Form

Method Summary
 boolean eq(Term t)
           
 int getInt()
          get integer value, if this term represent integer, otherwise throw UnsupportedOperationException
static IntTerm getIntTerm(int v)
           
 String getName()
          get name of functional symbol.
 Number getNumber()
          get numeric value, if this term represent number, otherwise throw UnsupportedOperationException
 int getPrimaryType0()
          return code of level-0 primary type
 boolean isInt()
          is term is Int ?
 boolean isNumber()
          is term is Number ?
 void print(PrintWriter out)
          print term to out.
 Term termClone()
          int is immutable, so return this.
 int termCompare(Term t)
          compare functions.
 
Methods inherited from class ua.gradsoft.termware.AbstractPrimitiveTerm
boundEquals, boundUnify, clone, concreteOrder, createSame, emptyFv, findSubtermIndexBoundEqualsTo, freeEquals, freeUnify, getArity, getBigDecimal, getBigInteger, getBoolean, getByte, getChar, getDouble, getFloat, getJavaObject, getLong, getNameIndex, getPatternName, getPatternNameIndex, getShort, getString, getSubtermAt, getTerm, getXIndex, isAtom, isBigDecimal, isBigInteger, isBoolean, isByte, isChar, isComplexTerm, isDouble, isFloat, isJavaObject, isLong, isNil, isShort, isString, isX, maxFv, minFv, setSubtermAt, shiftFv, subst, substInside
 
Methods inherited from class ua.gradsoft.termware.Term
containsSubtermBoundEqualsTo, getAsBigDecimal, getAsBigInteger, getAsBoolean, getAsByte, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsJavaObject, getAsLong, getAsNumber, getAsShort, getAsString, getPrimaryType1, print, println, println
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIntTerm

public static IntTerm getIntTerm(int v)

getPrimaryType0

public final int getPrimaryType0()
Description copied from class: Term
return code of level-0 primary type

Specified by:
getPrimaryType0 in class Term
Returns:
PrimaryTypes.INT
See Also:
PrimaryTypes

isNumber

public final boolean isNumber()
Description copied from class: Term
is term is Number ?

Specified by:
isNumber in class Term
Returns:
true
See Also:
Term.isNumber()

getNumber

public final Number getNumber()
Description copied from class: Term
get numeric value, if this term represent number, otherwise throw UnsupportedOperationException

Specified by:
getNumber in class Term
Returns:
number value
See Also:
Term.getNumber()

isInt

public final boolean isInt()
Description copied from class: Term
is term is Int ?

Overrides:
isInt in class AbstractPrimitiveTerm
Returns:
true if term represents integer value.

getInt

public final int getInt()
Description copied from class: Term
get integer value, if this term represent integer, otherwise throw UnsupportedOperationException

Overrides:
getInt in class AbstractPrimitiveTerm
Returns:
int value

getName

public final String getName()
Description copied from class: Term
get name of functional symbol.

Specified by:
getName in class AbstractPrimitiveTerm
Returns:
name

eq

public final boolean eq(Term t)
Specified by:
eq in class AbstractPrimitiveTerm

termClone

public Term termClone()
int is immutable, so return this.

Specified by:
termClone in class AbstractPrimitiveTerm

termCompare

public final int termCompare(Term t)
Description copied from class: Term
compare functions. define ordering on set of terms. Note, that ordering is not the same as Java build-in compare.

Specified by:
termCompare in class AbstractPrimitiveTerm
Parameters:
t - - term to compare
See Also:
Term.termCompare(ua.gradsoft.termware.Term)

print

public final void print(PrintWriter out)
Description copied from class: AbstractPrimitiveTerm
print term to out. does not expect recursion.

Specified by:
print in class AbstractPrimitiveTerm
Parameters:
out - - PrintWriter, where to print term.