ua.gradsoft.termware
Class AtomTerm

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

public final class AtomTerm
extends AbstractPrimitiveTerm

Term, which represent atom. (i. e. uninterpreterted entity)

See Also:
Serialized Form

Method Summary
 PartialOrderingResult concreteOrder(Term x, Substitution s)
          compare for 'more concrete' relation.
 boolean eq(Term x)
          check for equality.
 String getName()
          return name of atom.
 Object getNameIndex()
          get index of name in instance symbol table.
 Number getNumber()
          get number.
 int getPrimaryType0()
          return typename0 - "atom"
 boolean isAtom()
          true, if term is atom.
 boolean isNumber()
          is this is number.
 void print(PrintWriter out)
          print term to out.
 Term termClone()
          return self, since atoms are immutable.
 int termCompare(Term t)
          universal compare this and t
 String toString()
           
 
Methods inherited from class ua.gradsoft.termware.AbstractPrimitiveTerm
boundEquals, boundUnify, clone, createSame, emptyFv, findSubtermIndexBoundEqualsTo, freeEquals, freeUnify, getArity, getBigDecimal, getBigInteger, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getJavaObject, getLong, getPatternName, getPatternNameIndex, getShort, getString, getSubtermAt, getTerm, getXIndex, isBigDecimal, isBigInteger, isBoolean, isByte, isChar, isComplexTerm, isDouble, isFloat, isInt, 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, wait, wait, wait
 

Method Detail

getPrimaryType0

public final int getPrimaryType0()
return typename0 - "atom"

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

isAtom

public final boolean isAtom()
true, if term is atom.

Overrides:
isAtom in class AbstractPrimitiveTerm
Returns:
true

getName

public final String getName()
return name of atom.

Specified by:
getName in class AbstractPrimitiveTerm
Returns:
name of atom.

isNumber

public final boolean isNumber()
is this is number.

Specified by:
isNumber in class Term
Returns:
false

getNumber

public final Number getNumber()
                       throws UnsupportedOperationException
get number. throw UnsupporterOperationException

Specified by:
getNumber in class Term
Returns:
number value
Throws:
UnsupportedOperationException - raised if this term does not represent numeric value.

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)
check for equality.

Specified by:
eq in class AbstractPrimitiveTerm

termCompare

public final int termCompare(Term t)
universal compare this and t

Specified by:
termCompare in class AbstractPrimitiveTerm
Parameters:
t - - term to compare.
Returns:
v, which is:
  • <0, if this
  • =0, if this == x
  • >0, if this >!> t

concreteOrder

public final PartialOrderingResult concreteOrder(Term x,
                                                 Substitution s)
                                          throws TermWareException
Description copied from class: Term
compare for 'more concrete' relation. i. e. x.<(concrete)<(y) means, that for each substitution of free variables sx exists substituion sy : x[sx] = y[sy] .
Substitution s store previously matched variables.

Overrides:
concreteOrder in class AbstractPrimitiveTerm
Throws:
TermWareException

termClone

public final Term termClone()
return self, since atoms are immutable.

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.

toString

public final String toString()
Overrides:
toString in class Object