public class PLStructure extends PLTerm
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
isAtom, isFloat, isInteger, isList, isNil, isString, isStructure, isVariable
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.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(CiaoJava.PLInterpreter i)
PLStructure
object is returned itself.public boolean isRunnable()
isRunnable
in class PLTerm
true
(every Prolog structure
can be used to represent a Prolog goal).public boolean equals(PLTerm t)
public PLTerm copy()
PLStructure
Prolog structure
object. Recursively clones the arguments of this term.public boolean unify(PLTerm term)