public final class Compound extends Term
Constructor and Description |
---|
Compound(String name,
List<? extends Term> args) |
Compound(Term name,
List<? extends Term> args)
Creates a Compound with id and args.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(TermVisitor termVisitor)
Accepts a Jpc term visitor.
|
ListTerm |
asList()
Returns a list representation of this term.
|
protected boolean |
basicIsList() |
protected void |
basicRead(TermContentHandler contentHandler,
com.google.common.base.Function<Term,Term> termExpander) |
boolean |
equals(Object obj)
Two Compounds are equal if they are identical (same object) or their names and arities are equal and their
respective arguments are equal.
|
List<Term> |
getArgs()
Returns the arguments of this Compound (1..arity) of this Compound as a List of Term.
|
Functor |
getFunctor() |
Term |
getName()
Returns the id of this Compound.
|
String |
getNameString() |
boolean |
hasFunctor(Functor functor)
Whether this term has a given functor.
|
int |
hashCode() |
boolean |
hasName(String name) |
boolean |
hasName(Term term) |
boolean |
isCons() |
boolean |
isGround() |
boolean |
isHilog() |
Term |
preCompile(Environment env) |
Term |
prepareForFrame(Environment env) |
Term |
prepareForQuery(Environment env) |
boolean |
termEquals(Term term)
Test if this object is equivalent to the term representation of the object sent as parameter
This is not testing for equality in a mathematical sense, for example:
'new Variable("_").equals(new Variable("_"))'
is false, since both the receiver and the arguments are anonymous variables, not the same variable.
|
String |
toEscapedString()
Returns a prefix functional representation of a Compound of the form id(arg1,...),
|
String |
toString(OperatorsContext operatorsContext) |
void |
unify(Term term) |
boolean |
usesOperator(Operator operator) |
arg, arity, canUnify, changeVariablesNames, compile, compile, compile, compile, compileAndUnify, compileAndUnifyVars, getNamedVariables, getNamedVariablesNames, getNonUnderscoreVariableNames, getNonUnderscoreVariables, getVariableNames, getVariables, hasFunctor, hasFunctor, hasFunctor, hasFunctor, hasVariable, isList, listLength, prepareForFrame, prepareForQuery, read, read, replaceVariables, resolveBindings, termEquals, termExpansion, toEscapedString, toEscapedString, toString, unifyAndBind, varBindings
public boolean isHilog()
protected boolean basicIsList()
basicIsList
in class Term
public boolean isCons()
public ListTerm asList()
Term
public boolean hasName(String name)
public boolean hasName(Term term)
public boolean hasFunctor(Functor functor)
Term
hasFunctor
in class Term
functor
- the functor of this term.public Functor getFunctor()
public Term getName()
public String getNameString()
public List<Term> getArgs()
public boolean isGround()
public void accept(TermVisitor termVisitor)
Term
public boolean usesOperator(Operator operator)
protected void basicRead(TermContentHandler contentHandler, com.google.common.base.Function<Term,Term> termExpander)
public String toString(OperatorsContext operatorsContext)
public String toEscapedString()
toEscapedString
in class Term
public boolean equals(Object obj)
public boolean termEquals(Term term)
Term
termEquals
in class Term
public Term preCompile(Environment env)
preCompile
in class Term
public Term prepareForQuery(Environment env)
prepareForQuery
in class Term
public Term prepareForFrame(Environment env)
prepareForFrame
in class Term
Copyright © 2014. All rights reserved.