ua.gradsoft.termware
Class NILTerm

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

public final class NILTerm
extends AbstractPrimitiveTerm

Term, which represents NIL

See Also:
Serialized Form

Constructor Summary
NILTerm()
           
 
Method Summary
 boolean eq(Term x)
           
 String getName()
          return name of term.
 Object getNameIndex()
          get index of name in instance symbol table.
static Term getNILTerm()
          return Nil singleton
 Number getNumber()
          already throws UnsupportedOperationException
 int getPrimaryType0()
          return code of level-0 primary type
 boolean isNil()
          is term is nil ?
 boolean isNumber()
          is term is Number ?
 void print(PrintWriter out)
          print term to out.
 Term termClone()
          since term is immutable - do nothing
 int termCompare(Term x)
          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, getInt, getJavaObject, getLong, getPatternName, getPatternNameIndex, getShort, getString, getSubtermAt, getTerm, getXIndex, isAtom, isBigDecimal, isBigInteger, isBoolean, isByte, isChar, isComplexTerm, isDouble, isFloat, isInt, isJavaObject, isLong, 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
 

Constructor Detail

NILTerm

public NILTerm()
Method Detail

getNILTerm

public static final Term getNILTerm()
return Nil singleton


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.NIL
See Also:
PrimaryTypes

isNil

public final boolean isNil()
Description copied from class: Term
is term is nil ?

Overrides:
isNil in class AbstractPrimitiveTerm
Returns:
true

isNumber

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

Specified by:
isNumber in class Term
Returns:
false

getNumber

public final Number getNumber()
                       throws UnsupportedOperationException
already throws UnsupportedOperationException

Specified by:
getNumber in class Term
Returns:
number value
Throws:
UnsupportedOperationException

getName

public final String getName()
return name of term.

Specified by:
getName in class AbstractPrimitiveTerm
Returns:
"NIL"

getNameIndex

public final Object getNameIndex()
Description copied from class: Term
get index of name in instance symbol table. If name is not inde (during unifications names are compared by indexes. This allows to speedup unification process)

Overrides:
getNameIndex in class AbstractPrimitiveTerm

eq

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

termCompare

public final int termCompare(Term x)
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:
x - - term to compare

termClone

public final Term termClone()
since term is immutable - do nothing

Specified by:
termClone in class AbstractPrimitiveTerm

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.