|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.squashtest.csp.tm.domain.library.structures.TreeNode<T>
T - the type of the actual subclass.public abstract class TreeNode<T extends TreeNode<T>>
Please read also LibraryTree.
TreeNode is the type of node used by a LibraryTree. A TreeNode maintains informations regarding its position in the tree, ie its parent node, its layer/depth etc. Each node is identified
by a key, that will be used to identify each node uniquely. While that class does not override equals/hashCode using the key as the sole criteria, it proposes instead a method
(isSame(TreeNode) for that.
Subclasses of TreeNode should be genericized Enum-style, i.e. generics of themselves, and implement updateWith(TreeNode).
| Constructor Summary | |
|---|---|
TreeNode()
|
|
TreeNode(Long key)
|
|
| Method Summary | |
|---|---|
List<T> |
getChildren()
|
Long |
getKey()
|
boolean |
isSame(T node)
That method tells if two nodes refer to the same node. |
void |
setKey(Long key)
|
protected abstract void |
updateWith(T newData)
strongly recommended to override/specialize that method when you subtype that class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TreeNode()
public TreeNode(Long key)
| Method Detail |
|---|
public List<T> getChildren()
public Long getKey()
public void setKey(Long key)
public boolean isSame(T node)
That method tells if two nodes refer to the same node. Two nodes are considered as same if their keys are equal regardless of their other properties. A node compared to null is considered different. Two node having null keys are considered as same, thought that feature is not used in theory.
node -
protected abstract void updateWith(T newData)
newData -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||