public abstract class AbstractTreeGene<A,G extends AbstractTreeGene<A,G>> extends Object implements TreeGene<A,G>, Serializable
TreeGene interface..| Modifier | Constructor and Description | 
|---|---|
| protected  | AbstractTreeGene(A allele,
                int childOffset,
                int childCount)Creates a new tree-gene from the given data. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | bind(ISeq<G> genes)This method is used by the  AbstractTreeChromosometo attach
 itself to this gene. | 
| protected void | checkTreeState() | 
| int | childCount()Return the number of children this tree node consists of. | 
| int | childOffset()Return the index of the first child node in the underlying node array. | 
| boolean | equals(Object obj) | 
| ISeq<G> | flattenedNodes()Return the whole flattened tree values in breadth-first order. | 
| A | getAllele() | 
| G | getChild(int index)Return the child gene with the given index. | 
| Optional<G> | getParent()Return the parent node of this tree node. | 
| G | getRoot()Returns the root of the tree that contains this node. | 
| int | hashCode() | 
| boolean | identical(Tree<?,?> other)Tests whether  thisnode is the same as theothernode. | 
| boolean | isRoot()Returns  trueif this node is the root of the tree. | 
| boolean | isValid() | 
| int | size()Return the number of nodes of  thisnode (sub-tree). | 
| String | toString() | 
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetValue, newInstancenewInstance, newInstancebreadthFirstIterator, breadthFirstStream, childAfter, childAtPath, childBefore, childIterator, childStream, depth, depthFirstIterator, depthFirstStream, equals, firstChild, firstLeaf, getIndex, getPath, hashCode, isAncestor, isChild, isDescendant, isLeaf, isRelated, isSibling, iterator, lastChild, lastLeaf, leafCount, level, nextLeaf, nextNode, nextSibling, pathFromAncestorIterator, postorderIterator, postorderStream, preorderIterator, preorderStream, previousLeaf, previousNode, previousSibling, sharedAncestor, siblingCount, stream, toCompactString, toDottyString, toParenthesesString, toParenthesesString, toStringforEach, spliteratorprotected AbstractTreeGene(A allele, int childOffset, int childCount)
allele - the actual value (allele) of the tree-genechildOffset - the offset index of the child in the containing
        chromosome. If this node has no child, the value should be set
        to zero.childCount - the number of children of this geneIllegalArgumentException - if the childCount is smaller
         than zeropublic ISeq<G> flattenedNodes()
ISeq instance.flattenedNodes in interface FlatTree<A,G extends AbstractTreeGene<A,G>>public G getRoot()
Treepublic boolean isRoot()
Treetrue if this node is the root of the tree.public int size()
Treethis node (sub-tree).protected void checkTreeState()
protected void bind(ISeq<G> genes)
AbstractTreeChromosome to attach
 itself to this gene.genes - the genes of the attached chromosomepublic int childOffset()
FlatTree-1 is returned if this node is a leaf.childOffset in interface FlatTree<A,G extends AbstractTreeGene<A,G>>-1 if this node is a leafpublic Optional<G> getParent()
getParent in interface Tree<A,G extends AbstractTreeGene<A,G>>Optional.empty() if this node is the
         root of the treeIllegalStateException - if this gene is not part of a chromosomepublic G getChild(int index)
getChild in interface Tree<A,G extends AbstractTreeGene<A,G>>index - the child indexIndexOutOfBoundsException - if the index is out of
         bounds ([0, childCount()))IllegalStateException - if this gene is not part of a chromosomepublic int childCount()
TreechildCount in interface Tree<A,G extends AbstractTreeGene<A,G>>public boolean isValid()
isValid in interface Verifiablepublic boolean identical(Tree<?,?> other)
Treethis node is the same as the other node.
 The default implementation returns the object identity,
 this == other, of the two objects, but other implementations may
 use different criteria for checking the identity.© 2007-2018 Franz Wilhelmstötter (2018-10-28 17:23)