Type
- Type of the children.public class SortedTreeNode<Type extends SortedTree<Type>> extends java.lang.Object implements SortedTree<Type>
Docu_UML_simpleNotation
:
SortedTreeNode -key |-------obj------>Type (data) | |-------------key*>-------------*>| | Type (children) |-------------------------------*>| |--------------> SortedTreeNodeThe node refers to some Instances from Type. The instances can be selected by a key, whereby more as one instance with the same key is possible.
TreeNodeUniqueKey
, it is another implementation of a node for a tree.
This class is designated as deprecated. The problem of this class is: children are referenced
directly with there data. Instead the child nodes should be referenced.
For example the org.vishia.xmlSimle.XmlNodeSimple
has contained extra references to its
children if this class was used as subclass. Now this associations are contained in the
used subclass TreeNodeBase
.Modifier and Type | Field and Description |
---|---|
(package private) Type |
obj |
(package private) java.lang.String |
sKey |
(package private) java.util.TreeMap<java.lang.String,java.util.LinkedList<Type>> |
sortedChildren |
(package private) java.util.List<Type> |
unsortedChildren |
Constructor and Description |
---|
SortedTreeNode() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String itsKey,
Type newElement)
adds a child.
|
Type |
getChild(java.lang.String key)
implements the interface method from
SortedTree . |
Type |
getParent() |
java.util.Iterator<Type> |
iterChildren()
implements the interface method from
SortedTree . |
java.util.Iterator<Type> |
iterChildren(java.lang.String key)
implements the interface method from
SortedTree . |
java.util.List<Type> |
listChildren()
implements the interface method from
SortedTree . |
java.util.List<Type> |
listChildren(java.lang.String key)
implements the interface method from
SortedTree . |
java.lang.String sKey
Type extends SortedTree<Type> obj
java.util.TreeMap<java.lang.String,java.util.LinkedList<Type extends SortedTree<Type>>> sortedChildren
java.util.List<Type extends SortedTree<Type>> unsortedChildren
public void add(java.lang.String itsKey, Type newElement)
itsKey
- The key may be free defined outside, independent of the content of the child.
This key is used to find out children.newElement
- The child to add.public Type getParent()
getParent
in interface SortedTree<Type extends SortedTree<Type>>
public Type getChild(java.lang.String key)
SortedTree
.getChild
in interface SortedTree<Type extends SortedTree<Type>>
key
- The key of the demanded child. The implementation may have extra possibilities in addressing children
with strings. The sKey can be representing more as a simple string as a attribute in children.
It may be comparable with the ability of XPATH in XML.
But it will be a feature of Implementation and is not defined as a basic feature of this interface.
public java.util.Iterator<Type> iterChildren()
SortedTree
.iterChildren
in interface SortedTree<Type extends SortedTree<Type>>
public java.util.Iterator<Type> iterChildren(java.lang.String key)
SortedTree
.iterChildren
in interface SortedTree<Type extends SortedTree<Type>>
key
- The key of the demanded child. The implementation may have extra possibilities, see getChild(String).public java.util.List<Type> listChildren()
SortedTree
.listChildren
in interface SortedTree<Type extends SortedTree<Type>>
public java.util.List<Type> listChildren(java.lang.String key)
SortedTree
.listChildren
in interface SortedTree<Type extends SortedTree<Type>>
key
- The key of the demanded child. The implementation may have extra possibilities, see getChild(String).