|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.svincent.moksa.WamObject
|
+--com.svincent.moksa.PrologTerm
Represents a WAM first-order term (i.e. - a Variable or a CompoundTerm).
Every term has one of the following types
Note that a term of type integer,
floating-point, or atom is a
constant. This condition can be tested with the
isConstant method.
| Field Summary | |
static PrologTerm[] |
EmptyArray
A static empty array of PrologTerms. |
| Constructor Summary | |
PrologTerm(PrologEngine _engine)
|
|
| Method Summary | |
java.lang.Object |
accept(PrologTermVisitor v,
java.lang.Object parm)
Allow PrologTermVisitor to access this PrologTerm. |
PrologTerm |
clonePrologTerm()
|
abstract PrologTerm |
clonePrologTerm(java.util.Map objs)
|
PrologTerm |
deref()
Dereferences this PrologTerm, retrieving the PrologTerm that it represents. |
PrologTerm |
evaluateExpression()
Evaluates this term as an expression. |
double |
floatValue()
Returns this PrologTerm's floating-point value. |
int |
getArity()
Retrieve the arity of this term. |
abstract java.lang.String |
getName()
|
PrologTerm |
getNameConstant()
|
int |
getPriority()
|
int |
intValue()
Returns this PrologTerm's integral value. |
boolean |
isAtom()
Returns true iff this is an Atom. |
boolean |
isCompoundTerm()
Returns true iff this is a CompoundTerm. |
boolean |
isConstant()
Returns true iff this is an constant: that is, if it is an Atom, an integer constant, or a floating-point constant. |
boolean |
isEmptyList()
|
boolean |
isFloat()
Returns true iff this is a floating-point constant. |
boolean |
isInteger()
Returns true iff this is a integer constant. |
boolean |
isJavaObject()
Returns true iff this is a Java object wrapper. |
boolean |
isList()
Returns true iff this is a List. |
boolean |
isNonEmptyList()
|
boolean |
isStreamId()
Returns true iff this is a Stream Identifier. |
boolean |
isStructure()
Return true iff this is a CompoundTerm or an Atom |
boolean |
isVariable()
Returns true iff this is a Variable. |
void |
printVariables(java.io.PrintWriter out)
|
void |
setPriority(int _priority)
|
boolean |
unify(PrologTerm that)
Unification algorithm. |
abstract boolean |
unify(PrologTerm that,
boolean doBindings)
Unification algorithm. |
boolean |
unifyWithoutBindings(PrologTerm that)
|
void |
untrail()
Default behavior for untrailing is to do nothing. |
| Methods inherited from class com.svincent.moksa.WamObject |
tag,
tag |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final PrologTerm[] EmptyArray
| Constructor Detail |
public PrologTerm(PrologEngine _engine)
| Method Detail |
public int getPriority()
public void setPriority(int _priority)
public abstract java.lang.String getName()
public int getArity()
public PrologTerm getNameConstant()
public int intValue()
Returns this PrologTerm's integral value. Only certain prologTerm types can be viewed this way: the others throw exceptions.
public double floatValue()
Returns this PrologTerm's floating-point value. Only certain prologTerm types can be viewed this way: the others throw exceptions.
public java.lang.Object accept(PrologTermVisitor v,
java.lang.Object parm)
public boolean isVariable()
public boolean isJavaObject()
public boolean isStructure()
public boolean isCompoundTerm()
public boolean isList()
public boolean isEmptyList()
public boolean isNonEmptyList()
public boolean isInteger()
public boolean isFloat()
public boolean isAtom()
public boolean isConstant()
public boolean isStreamId()
public PrologTerm deref()
Unbound variables and all other PrologTerms return themselves.
public boolean unify(PrologTerm that)
public boolean unifyWithoutBindings(PrologTerm that)
public abstract boolean unify(PrologTerm that,
boolean doBindings)
doBindings - Pass in true if you want matched variables to
be bound.public PrologTerm clonePrologTerm()
public abstract PrologTerm clonePrologTerm(java.util.Map objs)
public PrologTerm evaluateExpression()
throws PrologException
public void untrail()
Default behavior for untrailing is to do nothing.
Note that since most PrologTerms are never placed on the trail stack, this method will not be called for many PrologTerm types (CompoundTerms and Numbers come to mind)
public void printVariables(java.io.PrintWriter out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/
Copyright © 1999 Shawn P. Vincent.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.