ua.gradsoft.termware
Class StringTerm

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

public class StringTerm
extends AbstractPrimitiveTerm

Term which contains string.

See Also:
Term, Serialized Form

Constructor Summary
StringTerm(String s)
          constructor
 
Method Summary
 boolean eq(Term x)
          are term logically equals to x ?
 String getName()
          get name of functional symbol.
 Number getNumber()
          in this class just throws UnsupportedOperationException
 int getPrimaryType0()
          return code of level-0 primary type
 String getString()
          return incapsulated string.
 boolean isNumber()
          is term is Number ?
 boolean isString()
          is Term is string ?
 void print(PrintWriter out)
          print term to out
 Term termClone()
          String 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, getInt, getJavaObject, getLong, getNameIndex, getPatternName, getPatternNameIndex, getShort, getSubtermAt, getTerm, getXIndex, isAtom, isBigDecimal, isBigInteger, isBoolean, isByte, isChar, isComplexTerm, isDouble, isFloat, isInt, isJavaObject, isLong, isNil, isShort, 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

StringTerm

public StringTerm(String s)
constructor

Method Detail

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

isString

public final boolean isString()
Description copied from class: Term
is Term is string ?

Overrides:
isString in class AbstractPrimitiveTerm
Returns:
true

getString

public final String getString()
return incapsulated string.

Overrides:
getString in class AbstractPrimitiveTerm
Returns:
string

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()
in this class just throws UnsupportedOperationException

Specified by:
getNumber in class Term
Returns:
number value

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)

getName

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

Specified by:
getName in class AbstractPrimitiveTerm
Returns:
incapsulated string

eq

public boolean eq(Term x)
are term logically equals to x ?

Specified by:
eq in class AbstractPrimitiveTerm
Parameters:
x - - term to compare
Returns:
true, if values are equal

termClone

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

Specified by:
termClone in class AbstractPrimitiveTerm

print

public void print(PrintWriter out)
print term to out

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