|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.omnifaces.model.tree.ListTreeModel<T>
T
- The type of the wrapped data of the tree node.public class ListTreeModel<T>
A concrete implementation of TreeModel
which holds the tree children in a List
.
Constructor Summary | |
---|---|
ListTreeModel()
|
Method Summary | |
---|---|
TreeModel<T> |
addChild(T data)
Creates and adds a child tree node with the given wrapped data to the current tree node. |
TreeModel<T> |
addChildNode(TreeModel<T> child)
Adds the given child tree node to the current tree node. |
boolean |
equals(java.lang.Object object)
|
int |
getChildCount()
Returns the count of the children of the current tree node. |
java.util.List<TreeModel<T>> |
getChildren()
Returns an unmodifiable list of all child tree nodes of the current tree node. |
T |
getData()
Returns the wrapped data of the current tree node. |
java.lang.String |
getIndex()
Returns the zero-based unique index of the current tree node. |
int |
getLevel()
Returns the level of the current tree node. |
TreeModel<T> |
getNextSibling()
Returns the next tree node sibling of the current tree node. |
TreeModel<T> |
getParent()
Returns the parent tree node of the current tree node. |
TreeModel<T> |
getPreviousSibling()
Returns the previous tree node sibling of the current tree node. |
int |
hashCode()
|
boolean |
isFirst()
Returns whether the current tree node is the first child of its parent, if any. |
boolean |
isLast()
Returns whether the current tree node is the last child of its parent, if any. |
boolean |
isLeaf()
Returns whether the current tree node is a leaf node. |
boolean |
isRoot()
Returns whether the current tree node is the root node. |
java.util.Iterator<TreeModel<T>> |
iterator()
Returns an unmodifiable iterator over the children of the current tree node. |
TreeModel<T> |
remove()
Removes the current tree node from its parent, if any. |
void |
setData(T data)
Sets the wrapped data of the current tree node. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ListTreeModel()
Method Detail |
---|
public void setData(T data)
TreeModel
setData
in interface TreeModel<T>
data
- The wrapped data of current tree node.public TreeModel<T> addChild(T data)
TreeModel
addChild
in interface TreeModel<T>
data
- The wrapped data of the child tree node to be created and added.
public TreeModel<T> addChildNode(TreeModel<T> child)
TreeModel
addChildNode
in interface TreeModel<T>
child
- The child tree node to be added.
public TreeModel<T> remove()
TreeModel
remove
in interface TreeModel<T>
public T getData()
TreeModel
getData
in interface TreeModel<T>
public TreeModel<T> getParent()
TreeModel
null
if there is none.
getParent
in interface TreeModel<T>
public TreeModel<T> getNextSibling()
TreeModel
null
if there is none.
getNextSibling
in interface TreeModel<T>
public TreeModel<T> getPreviousSibling()
TreeModel
null
if there is none.
getPreviousSibling
in interface TreeModel<T>
public int getChildCount()
TreeModel
getChildCount
in interface TreeModel<T>
public java.util.List<TreeModel<T>> getChildren()
TreeModel
TreeModel.addChild(Object)
method on the
tree node parent. Removing children should be done by the TreeModel.remove()
method on the tree node itself.
getChildren
in interface TreeModel<T>
public java.util.Iterator<TreeModel<T>> iterator()
TreeModel
iterator
in interface java.lang.Iterable<TreeModel<T>>
iterator
in interface TreeModel<T>
Iterable
public int getLevel()
TreeModel
getLevel
in interface TreeModel<T>
public java.lang.String getIndex()
TreeModel
null
. The first child has
index 0
. The second child of first child has index 0_1
. The first child of second child
of third child has index 2_1_0
.
getIndex
in interface TreeModel<T>
public boolean isRoot()
TreeModel
isRoot
in interface TreeModel<T>
true
if the current tree node is the root node, otherwise false
.public boolean isLeaf()
TreeModel
isLeaf
in interface TreeModel<T>
true
if the current tree node is a leaf node, otherwise false
.public boolean isFirst()
TreeModel
isFirst
in interface TreeModel<T>
true
if the current tree node is the first child of its parent, otherwise false
.public boolean isLast()
TreeModel
isLast
in interface TreeModel<T>
true
if the current tree node is the last child of its parent, otherwise false
.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |