|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--CiaoJava.PLTerm | +--CiaoJava.PLStructure
This class is used to represent in Java the Prolog compound terms. This is the basic construct to manage requests, answers and goals in the Java side of this interface.
Field Summary | |
(package private) PLTerm[] |
Args
|
(package private) int |
Arity
|
(package private) java.lang.String |
Name
|
Constructor Summary | |
PLStructure(java.lang.String name,
int arity,
PLTerm[] arg)
Creates a new PLStructure object
with the functor, arity and arguments received as parameters. |
|
PLStructure(java.lang.String name,
PLTerm[] arg)
Creates a new PLStructure object. |
Method Summary | |
void |
backtrack(PLTerm term)
|
PLTerm |
copy()
Makes a full copy of this PLStructure Prolog structure
object. |
boolean |
equals(PLTerm t)
comparison between Prolog terms. |
PLTerm |
getArg(int argNumber)
Returns the argument number argNumber , received
as argument. |
PLTerm[] |
getArgs()
Returns an array of Prolog terms containing the arguments of this structure. |
int |
getArity()
Returns the arity of this Prolog structure. |
java.lang.String |
getFunctor()
Returns the functor name of this Prolog structure. |
boolean |
isRunnable()
Execution test on Prolog objects. |
java.lang.Object |
javaRepr(PLInterpreter i)
Java representation of a structure. |
void |
launchGoal(PLConnection pl)
Goal launching. |
void |
launchGoal(PLInterpreter interpreter,
PLConnection pl)
Goal launching. |
protected int |
numberOfCells()
|
java.lang.String |
toString()
String representation of a Prolog structure. |
boolean |
unify(PLTerm term)
Term unification. |
Methods inherited from class CiaoJava.PLTerm |
fastRead,
fastWrite,
genPrefix,
genTerm,
getChar,
getFloat,
getInt,
getPrefix,
getString,
getTerm,
isException,
isList,
isNil,
isPrologFail,
isPrologSuccess,
isQueryId,
isSolution,
isString,
isStructure,
isVariable,
launchGoal |
Methods inherited from class java.lang.Object |
|
Field Detail |
java.lang.String Name
int Arity
PLTerm[] Args
Constructor Detail |
public PLStructure(java.lang.String name, int arity, PLTerm[] arg)
PLStructure
object
with the functor, arity and arguments received as parameters.name
- Functor name.arity
- Structure arity.arg
- Array of Prolog arguments.public PLStructure(java.lang.String name, PLTerm[] arg)
PLStructure
object.
Creates the Prolog structure using the functor and
argument list received as parameters.name
- Functor name.arg
- Array of Prolog arguments.Method Detail |
public java.lang.String toString()
public java.lang.String getFunctor()
public int getArity()
public PLTerm[] getArgs()
PLTerm
objects that
contains the arguments of this structure.public PLTerm getArg(int argNumber)
argNumber
, received
as argument.argNumber
- Position of the argument to be returned.argNumber
of the argument list.public java.lang.Object javaRepr(PLInterpreter i)
PLStructure
object is returned itself.i
- PLInterpreter
object used to
build the Java representation.public boolean isRunnable()
true
(every Prolog structure
can be used to represent a Prolog goal).public boolean equals(PLTerm t)
t
- Prolog term to be compared to.true
if this structure is equal
to the Prolog term received as argument;
false
otherwise.public PLTerm copy()
PLStructure
Prolog structure
object. Recursively clones the arguments of this term.PLTerm
object that contains a full copy
of this Prolog structure; that is, no argument is shared
between this object and the Prolog term returned.public boolean unify(PLTerm term)
term
- Term to unify with.public void backtrack(PLTerm term) throws PLException
protected int numberOfCells()
public void launchGoal(PLInterpreter interpreter, PLConnection pl)
interpreter
- PLInterpreter
object used to interpret
the arguments of this structure before launching
to the Prolog process.pl
- PLConnection
object that represents
the connection to the Prolog process.public void launchGoal(PLConnection pl)
pl
- PLConnection
object that represents
the connection to the Prolog process.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |