|
|||||||||
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.
Fields inherited from class CiaoJava.PLTerm |
fail, nil, success |
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 | |
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(CiaoJava.PLInterpreter i)
Java representation of a structure. |
java.lang.String |
toString()
String representation of a Prolog structure. |
boolean |
unify(PLTerm term)
Term unification. |
Methods inherited from class CiaoJava.PLTerm |
isList, isNil, isString, isStructure, isVariable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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()
toString
in class PLTerm
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(CiaoJava.PLInterpreter i)
PLStructure
object is returned itself.javaRepr
in class PLTerm
i
- PLInterpreter
object used to
build the Java representation.public boolean isRunnable()
isRunnable
in class PLTerm
true
(every Prolog structure
can be used to represent a Prolog goal).public boolean equals(PLTerm t)
equals
in class PLTerm
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.copy
in class PLTerm
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)
unify
in class PLTerm
term
- Term to unify with.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |