public class Struct extends Term
Constructor and Description |
---|
Struct()
Builds a structure representing an empty list
|
Struct(String f)
Builds a Struct representing an atom
|
Struct(String f,
Term at0)
Builds a compound, with one argument
|
Struct(String f,
Term[] argList)
Builds a compound, with an array of arguments
|
Struct(String f,
Term at0,
Term at1)
Builds a compound, with two arguments
|
Struct(String f,
Term at0,
Term at1,
Term at2)
Builds a compound, with three arguments
|
Struct(String f,
Term at0,
Term at1,
Term at2,
Term at3)
Builds a compound, with four arguments
|
Struct(String f,
Term at0,
Term at1,
Term at2,
Term at3,
Term at4)
Builds a compound, with five arguments
|
Struct(String f,
Term at0,
Term at1,
Term at2,
Term at3,
Term at4,
Term at5)
Builds a compound, with six arguments
|
Struct(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
|
void |
free()
dummy method
|
Term |
getArg(int index)
Gets the i-th element of this structure
No bound check is done
|
Struct |
getArg(String name)
Gets an argument inside this structure, given its name
|
int |
getArity()
Gets the number of elements of this structure
|
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 |
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.
|
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.
|
String |
toString()
Gets the string representation of this structure
Specific representations are provided for lists and atoms.
|
copyGoal, copyResult, createTerm, createTerm, equals, getIterator, match, parse, parse, resolveTerm, unify
public Struct(String f)
public Struct(String f, Term at0, Term at1, Term at2)
public Struct(String f, Term at0, Term at1, Term at2, Term at3)
public Struct(String f, Term at0, Term at1, Term at2, Term at3, Term at4)
public Struct(String f, Term at0, Term at1, Term at2, Term at3, Term at4, Term at5)
public Struct(String f, Term at0, Term at1, Term at2, Term at3, Term at4, Term at5, Term at6)
public Struct()
public Struct(Term[] argList)
public int getArity()
public String getName()
public Term getArg(int index)
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(String name)
name
- name of the structurepublic boolean isGreater(Term t)
public boolean isEqual(Term t)
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 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 String toString()
public Term iteratedGoalTerm()
Term
iteratedGoalTerm
in class Term
public void accept(TermVisitor tv)
Term