ua.gradsoft.termware
Class BooleanTerm

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

public final class BooleanTerm
extends AbstractPrimitiveTerm

Term for representation of boolean value.

See Also:
Serialized Form

Method Summary
 boolean eq(Term x)
           
 boolean getBoolean()
          get boolean value, if this term represent boolean, otherwise throw UnsupportedOperationException
static BooleanTerm getBooleanTerm(boolean b)
           
 String getName()
          return string representation
 Number getNumber()
          get number value, if one exists.
 int getPrimaryType0()
          return code of level-0 primary type
 boolean isBoolean()
          is this term is boolean ?
 boolean isNumber()
          is this term is number ?
 void print(PrintWriter out)
          print term to out.
 Term termClone()
          since boolean is immutable, 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, getByte, getChar, getDouble, getFloat, getInt, getJavaObject, getLong, getNameIndex, getPatternName, getPatternNameIndex, getShort, getString, getSubtermAt, getTerm, getXIndex, isAtom, isBigDecimal, isBigInteger, 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, toString, wait, wait, wait
 

Method Detail

getBooleanTerm

public static BooleanTerm getBooleanTerm(boolean b)

getPrimaryType0

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

Specified by:
getPrimaryType0 in class Term
Returns:
code of primary type
See Also:
PrimaryTypes

isBoolean

public final boolean isBoolean()
is this term is boolean ?

Overrides:
isBoolean in class AbstractPrimitiveTerm
Returns:
true

getBoolean

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

Overrides:
getBoolean in class AbstractPrimitiveTerm
Returns:
boolean value

isNumber

public final boolean isNumber()
is this term is number ?

Specified by:
isNumber in class Term
Returns:
false

getNumber

public final Number getNumber()
get number value, if one exists. In our case - throw UnsupportedOperationException

Specified by:
getNumber in class Term
Returns:
number value

getName

public String getName()
return string representation

Specified by:
getName in class AbstractPrimitiveTerm
Returns:
name

eq

public final boolean eq(Term x)
Specified by:
eq 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

termClone

public final Term termClone()
since boolean is immutable, return this.

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.