Class NodeTerm
java.lang.Object
com.tangosol.coherence.dsltools.termtrees.Term
com.tangosol.coherence.dsltools.termtrees.NodeTerm
NodeTerm is the class used to represent trees of Terms that can have
children.
- Author:
- djl 2009.08.31
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.coherence.dsltools.termtrees.Term
Term.TermIterator
-
Constructor Summary
ConstructorDescriptionConstruct a new TermNode with the given functor.Construct a new TermNode with the given functor and given Terms.Construct a new TermNode with the given functor and given Terms.Construct a new TermNode with the given functor and given Terms.Construct a new TermNode with the given functor and given Terms.Construct a new TermNode with the given functor and given Terms.Construct a new TermNode with the given functor and given Terms.Construct a new TermNode with the given functor and given Terms.Construct a new TermNode with the given functor and given Terms. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(TermWalker walker) Do a dispatch back to the given walker.Term[]
children()
Obtain the childern TermsAnswer a String representation of the Term that is allowed to show more internal details than toString() which does not compress information.Obtain the functor representation of the Term.boolean
isAtom()
Answer whether the receiver is an Atomic Term.boolean
isLeaf()
Answer whether the receiver has children.int
length()
Answer whether the length of the receivers childrenvoid
setFunctor
(String sFunctor) Set the receiver's functor to be the given StringtermAt
(int index) Obtain the child term at the given index.boolean
Answer whether the receiver is equal to the given Term.toString()
Return a human-readable description for this Node.Join the receiver with the given child Term.Methods inherited from class com.tangosol.coherence.dsltools.termtrees.Term
childrenTermEqual, findAttribute, findChild, headChildrenTermEqual, isNumber, iterator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
NodeTerm
Construct a new TermNode with the given functor.- Parameters:
sFunctor
- the functor for the Term
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the Termt1
- a child term
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the Termt1
- a child termt2
- a child term
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the Termt1
- a child termt2
- a child termt3
- a child term
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the Termt1
- a child termt2
- a child termt3
- a child termt4
- a child term
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the Termt1
- a child termt2
- a child termt3
- a child termt4
- a child termt5
- a child term
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the TermaTerms
- children of the node
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the Termterm
- a termaTerms
- children of the node
-
NodeTerm
Construct a new TermNode with the given functor and given Terms.- Parameters:
sFunctor
- the functor for the TermaTerms
- children of the nodeterm
- a term
-
-
Method Details
-
getFunctor
Obtain the functor representation of the Term.- Specified by:
getFunctor
in classTerm
- Returns:
- the functor
-
isLeaf
public boolean isLeaf()Answer whether the receiver has children. -
isAtom
public boolean isAtom()Answer whether the receiver is an Atomic Term. -
children
Obtain the childern Terms -
length
public int length()Answer whether the length of the receivers children -
termAt
Obtain the child term at the given index. The index is 1 based for children and with at(0) returning the functor as an AtomicTerm. Beware, your 0 based habits can cause problems but 1 based indexing is useful since the functor is an interesting part of the information space. We are bowing here to the wisdom of Mathematica Expressions. -
withChild
Join the receiver with the given child Term. AtomicTerms will construct a general list term (functor .list.) and NodeTerms may be mutated. -
termEqual
Answer whether the receiver is equal to the given Term. Terms are equal if their functors are equal and their children are termEqual to the children of the given term. -
fullFormString
Answer a String representation of the Term that is allowed to show more internal details than toString() which does not compress information. Similar to Object.toString().- Specified by:
fullFormString
in classTerm
- Returns:
- a String representation of the receiver
-
accept
Description copied from class:Term
Do a dispatch back to the given walker. -
toString
Return a human-readable description for this Node. -
setFunctor
Set the receiver's functor to be the given String- Parameters:
sFunctor
- the new functor for this Term
-