public class TermNode extends Printable
Modifier and Type | Class and Description |
---|---|
static class |
TermNode.TraverseCallBack
This class may be used to
traverse a term tree and
execute an arbitrary operation on every node.
|
Constructor and Description |
---|
TermNode(TermAtom atom,
Hedge hedge)
Instantiates a new term node.
|
Modifier and Type | Method and Description |
---|---|
TermNode |
apply(Map<Variable,TermNode> sigma)
Applies a substitution recursively and returns the new
TermNode.
|
TermNode |
copy() |
boolean |
equals(Object other) |
TermAtom |
getAtom() |
Hedge |
getHedge() |
int |
hashCode() |
boolean |
isNullAtom()
Tests whether the atom of this term node is the null atom.
|
boolean |
occurs(TermAtom atomOcc) |
void |
print(Writer out) |
TermNode |
replaceHole(Hedge plugIn)
Replaces the hole in this context with the given hedge.
|
void |
setAtom(TermAtom atom)
Null values are transformed to unique objects which represent the null
value.
|
void |
setHedge(Hedge hedge)
Null values are transformed to unique objects which represent the null
value.
|
TermNode |
substitute(Variable from,
TermNode to)
|
String |
toString() |
boolean |
traverse(TermNode.TraverseCallBack callBack)
Traverses the term tree and executes the callback function at every node.
|
public static final TermNode EMPTY
public TermNode(TermAtom atom, Hedge hedge)
TermAtom.nullAtom
,
Hedge.nullHedge
public TermNode apply(Map<Variable,TermNode> sigma)
public TermNode copy()
public TermAtom getAtom()
public Hedge getHedge()
public boolean isNullAtom()
public boolean occurs(TermAtom atomOcc)
public void print(Writer out) throws IOException
print
in class Printable
IOException
public TermNode replaceHole(Hedge plugIn)
public void setAtom(TermAtom atom)
TermAtom.nullAtom
public void setHedge(Hedge hedge)
Hedge.nullHedge
public boolean traverse(TermNode.TraverseCallBack callBack)
TermNode.TraverseCallBack