public class Var extends Term
Term
,
Serialized FormConstructor and Description |
---|
Var()
Creates an anonymous variable
This is equivalent to build a variable with name _
|
Var(String n)
Creates a variable identified by a name.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TermVisitor tv)
Visitor pattern
|
void |
free()
De-unify the variable
|
static void |
free(List<Var> varsUnified)
De-unify the variables of list
|
Term |
getLink()
Gets the term which is direct referred by the variable.
|
String |
getName()
Gets the name of the variable
|
String |
getOriginalName()
Gets the name of the variable
|
Term |
getTerm()
Gets the term which is referred by the variable.
|
boolean |
isAnonymous()
Tests if this variable is ANY
|
boolean |
isAtom()
is this term a prolog (alphanumeric) atom?
|
boolean |
isAtomic()
is this term a constant prolog term?
|
boolean |
isBound()
Tests if this variable is bound
|
boolean |
isCompound()
is this term a prolog compound term?
|
boolean |
isEmptyList()
is this term a null term?
|
boolean |
isEqual(Term t)
Tests if this term is (logically) equal to another
|
boolean |
isGreater(Term t)
Gets a copy of this variable
|
boolean |
isGreaterRelink(Term t,
ArrayList<String> vorder) |
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 |
isStruct()
is this term a struct?
|
boolean |
isVar()
is this term a variable?
|
void |
setName(String s) |
String |
toString()
Gets the string representation of this variable.
|
String |
toStringFlattened()
Gets the string representation of this variable, providing
the string representation of the linked term in the case of
bound variable
|
copyGoal, copyResult, createTerm, createTerm, equals, getIterator, iteratedGoalTerm, match, parse, parse, resolveTerm, unify
public Var(String n)
n
- is the nameInvalidTermException
- if n is not a valid Prolog variable namepublic Var()
public String getName()
public String getOriginalName()
public Term getTerm()
public Term getLink()
public boolean isNumber()
Term
public boolean isStruct()
Term
public boolean isVar()
Term
public boolean isEmptyList()
Term
isEmptyList
in class Term
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 isAnonymous()
public boolean isBound()
public boolean isGreater(Term t)
public boolean isGreaterRelink(Term t, ArrayList<String> vorder)
isGreaterRelink
in class Term
public boolean isEqual(Term t)
Term
public void setName(String s)
public String toString()
public String toStringFlattened()
public void accept(TermVisitor tv)
Term