E
- the data object represented in the node treepublic class NodeTree<E extends DataObject<E>>
extends java.lang.Object
Constructor and Description |
---|
NodeTree(DataObjectDefinition<E> type)
creates an empty node tree for the given type
|
NodeTree(E parent)
creates a node tree with the given object as root node
|
Modifier and Type | Method and Description |
---|---|
boolean |
addChild(E parent,
E child)
creates a link between the parent and the child.
|
java.lang.String |
generateNextTransientId()
generates transient id for objects when required
|
ObjectTreeDataElt<TObjectDataElt<E>> |
generateObjectTreeDataElt(java.lang.String name)
generates an object tree data element
|
E |
getChild(E parent,
int index)
get the child at the given index for the given parent
|
int |
getChildrenNumber(E parent)
get the number of children for the given parent
|
E |
getRoot()
get the root object for the tree
|
public NodeTree(DataObjectDefinition<E> type)
type
- type of data object definitionpublic NodeTree(E parent)
parent
- root node of the treepublic java.lang.String generateNextTransientId()
public boolean addChild(E parent, E child)
parent
- parent objectchild
- child objectpublic int getChildrenNumber(E parent)
parent
- parentpublic E getChild(E parent, int index)
parent
- parentindex
- index between 0 (included) and getChildrenNumber (excluded)public E getRoot()
public ObjectTreeDataElt<TObjectDataElt<E>> generateObjectTreeDataElt(java.lang.String name)
name
- name of the data element