ubc.cs.JLog.Foundation
Class jType

java.lang.Object
  extended by ubc.cs.JLog.Foundation.jType
All Implemented Interfaces:
iType
Direct Known Subclasses:
jTerm

public abstract class jType
extends java.lang.Object
implements iType

This abstract class defines all the prolog types. Use jType.getType() in place of instanceof for speed, and when only the actual instance type matters, and not any super classes. For sub classes, the type should be set in constructor only, and read-only from then on.

Any new types added to the system must be registered in this class. It is unlikely that this would be needed, since they are quite general.

Author:
Glendon Holst

Field Summary
 int type
           
 
Fields inherited from interface ubc.cs.JLog.Foundation.iType
TYPE_ARITHMETIC, TYPE_ATOM, TYPE_BUILTINPREDICATE, TYPE_COMMAND, TYPE_COMPARE, TYPE_COMPOUND, TYPE_CONS, TYPE_IF, TYPE_INTEGER, TYPE_LIST, TYPE_NULLLIST, TYPE_NUMERICCOMPARE, TYPE_OBJECT, TYPE_OPERATOR, TYPE_OR, TYPE_ORPREDICATE, TYPE_PREDICATE, TYPE_PREDICATETERMS, TYPE_REAL, TYPE_TYPE, TYPE_UNARYARITHMETIC, TYPE_UNARYOPERATOR, TYPE_UNDEFINED, TYPE_VARIABLE
 
Constructor Summary
jType()
           
 
Method Summary
 int getType()
           
protected  java.lang.String objectToString()
          Invokes the toString provided by the Object class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public int type
Constructor Detail

jType

public jType()
Method Detail

getType

public final int getType()
Specified by:
getType in interface iType

objectToString

protected java.lang.String objectToString()
Invokes the toString provided by the Object class. This is intended for classes whose superclasses have overridden toString, but need access to the default toString that the Object class returns.

Returns:
the String from Object.toString.