|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalice.tuprolog.Term
alice.tuprolog.Struct
Struct class represents both compound prolog term and atom term (considered as 0-arity compound).
Field Summary |
Fields inherited from class alice.tuprolog.Term |
FALSE, TRUE |
Constructor Summary | |
Struct()
Builds a structure representing an empty list |
|
Struct(java.lang.String f)
Builds a Struct representing an atom |
|
Struct(java.lang.String f,
Term at0)
Builds a compound, with one argument |
|
Struct(java.lang.String f,
Term[] argList)
Builds a compound, with an array of arguments |
|
Struct(java.lang.String f,
Term at0,
Term at1)
Builds a compound, with two arguments |
|
Struct(java.lang.String f,
Term at0,
Term at1,
Term at2)
Builds a compound, with three arguments |
|
Struct(java.lang.String f,
Term at0,
Term at1,
Term at2,
Term at3)
Builds a compound, with four arguments |
|
Struct(java.lang.String f,
Term at0,
Term at1,
Term at2,
Term at3,
Term at4)
Builds a compound, with five arguments |
|
Struct(java.lang.String f,
Term at0,
Term at1,
Term at2,
Term at3,
Term at4,
Term at5)
Builds a compound, with six arguments |
|
Struct(java.lang.String f,
Term at0,
Term at1,
Term at2,
Term at3,
Term at4,
Term at5,
Term at6)
Builds a compound, with seven arguments |
|
Struct(Term[] argList)
Builds a list specifying the elements |
|
Struct(Term h,
Term t)
Builds a list providing head and tail |
Method Summary | |
void |
append(Term t)
Appends an element to this structure supposed to be a list |
void |
free()
dummy method |
Term |
getArg(int index)
Gets the i-th element of this structure No bound check is done |
Struct |
getArg(java.lang.String name)
Gets an argument inside this structure, given its name |
int |
getArity()
Gets the number of elements of this structure |
java.lang.String |
getName()
Gets the functor name of this structure |
PrimitiveInfo |
getPrimitive()
Get primitive behaviour associated at structure |
Term |
getTerm()
Gets the actual term referred by this Term. |
Term |
getTerm(int index)
Gets the i-th element of this structure No bound check is done. |
boolean |
isAtom()
is this term a prolog (alphanumeric) atom? |
boolean |
isAtomic()
is this term a constant prolog term? |
boolean |
isClause()
Check is this struct is clause or directive |
boolean |
isCompound()
is this term a prolog compound term? |
boolean |
isEmptyList()
Is this structure an empty list? |
boolean |
isEqual(Term t)
Test if a term is equal to other |
boolean |
isGreater(Term t)
Test if a term is greater than other |
boolean |
isGround()
is this term a ground term? |
boolean |
isList()
is this term a prolog list? |
boolean |
isNumber()
is this term a prolog numeric term? |
boolean |
isPrimitive()
Check if this term is a primitive struct |
boolean |
isStruct()
is this term a struct |
boolean |
isVar()
is this term a variable |
Term |
iteratedGoalTerm()
The iterated-goal term G of a term T is a term defined recursively as follows: if T unifies with ^(_, Goal) then G is the iterated-goal term of Goal else G is T |
Term |
listHead()
Gets the head of this structure, which is supposed to be a list. |
java.util.Iterator |
listIterator()
Gets an iterator on the elements of this structure, which is supposed to be a list. |
int |
listSize()
Gets the number of elements of this structure, which is supposed to be a list. |
Struct |
listTail()
Gets the tail of this structure, which is supposed to be a list. |
java.lang.String |
toString()
Gets the string representation of this structure Specific representations are provided for lists and atoms. |
Methods inherited from class alice.tuprolog.Term |
copyGoal, copyResult, createTerm, createTerm, equals, getIterator, match, parse, parse, resolveTerm, unify |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Struct(java.lang.String f)
public Struct(java.lang.String f, Term at0)
public Struct(java.lang.String f, Term at0, Term at1)
public Struct(java.lang.String f, Term at0, Term at1, Term at2)
public Struct(java.lang.String f, Term at0, Term at1, Term at2, Term at3)
public Struct(java.lang.String f, Term at0, Term at1, Term at2, Term at3, Term at4)
public Struct(java.lang.String f, Term at0, Term at1, Term at2, Term at3, Term at4, Term at5)
public Struct(java.lang.String f, Term at0, Term at1, Term at2, Term at3, Term at4, Term at5, Term at6)
public Struct(java.lang.String f, Term[] argList)
public Struct()
public Struct(Term h, Term t)
public Struct(Term[] argList)
Method Detail |
public int getArity()
public java.lang.String getName()
public Term getArg(int index)
public Term getTerm(int index)
getArg(index).getTerm()
public boolean isNumber()
isNumber
in class Term
public boolean isStruct()
isStruct
in class Term
public boolean isVar()
isVar
in class Term
public boolean isAtomic()
Term
isAtomic
in class Term
public boolean isCompound()
Term
isCompound
in class Term
public boolean isAtom()
Term
isAtom
in class Term
public boolean isList()
Term
isList
in class Term
public boolean isGround()
Term
isGround
in class Term
public boolean isClause()
public Term getTerm()
Term
getTerm
in class Term
public Struct getArg(java.lang.String name)
name
- name of the structure
public boolean isGreater(Term t)
isGreater
in class Term
public boolean isEqual(Term t)
isEqual
in class Term
public boolean isEmptyList()
isEmptyList
in class Term
public Term listHead()
Gets the head of this structure, which is supposed to be a list.
If the callee structure is not a list, throws an UnsupportedOperationException
public Struct listTail()
Gets the tail of this structure, which is supposed to be a list.
If the callee structure is not a list, throws an UnsupportedOperationException
public int listSize()
Gets the number of elements of this structure, which is supposed to be a list.
If the callee structure is not a list, throws an UnsupportedOperationException
public java.util.Iterator listIterator()
Gets an iterator on the elements of this structure, which is supposed to be a list.
If the callee structure is not a list, throws an UnsupportedOperationException
public void append(Term t)
public void free()
free
in class Term
public PrimitiveInfo getPrimitive()
public boolean isPrimitive()
public java.lang.String toString()
public Term iteratedGoalTerm()
Term
iteratedGoalTerm
in class Term
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |