public class Struct extends Term
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TermVisitor tv)
Visitor pattern
|
void |
append(Term t)
Appends an element to this structure supposed to be a list
|
Term |
copyAndRetainFreeVar(java.util.AbstractMap<Var,Var> vMap,
int idExecCtx) |
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. if the Term is a bound variable, the method gets the Term linked to the variable
|
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 |
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<? extends Term> |
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.
|
void |
setArg(int index,
Term argument)
Sets the i-th element of this structure
(Only for internal service)
|
java.lang.String |
toString()
Gets the string representation of this structure
Specific representations are provided for lists and atoms.
|
copyGoal, copyResult, createTerm, createTerm, equals, fromJSON, getIterator, isEqual, isEqualObject, match, match, parse, parse, resolveTerm, toJSON, unify
public Struct(java.lang.String f)
public Struct(java.lang.String f, Term at0)
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[] argList)
public int getArity()
public java.lang.String getName()
public Term getArg(int index)
public void setArg(int index, Term argument)
public Term getTerm(int index)
getArg(index).getTerm()
public boolean isNumber()
public boolean isAtomic()
Term
public boolean isCompound()
Term
isCompound
in class Term
public boolean isAtom()
Term
public boolean isList()
Term
public boolean isGround()
Term
public boolean isClause()
public Term getTerm()
Term
public Struct getArg(java.lang.String name)
name
- name of the structurepublic boolean isGreater(Term t)
public Term copyAndRetainFreeVar(java.util.AbstractMap<Var,Var> vMap, int idExecCtx)
copyAndRetainFreeVar
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<? extends Term> 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 PrimitiveInfo getPrimitive()
public boolean isPrimitive()
public java.lang.String toString()
toString
in class java.lang.Object
public Term iteratedGoalTerm()
Term
iteratedGoalTerm
in class Term
public void accept(TermVisitor tv)
Term