- java.lang.Object
-
- org.omnifaces.model.tree.AbstractTreeModel<T>
-
- org.omnifaces.model.tree.SortedTreeModel<T>
-
- Type Parameters:
T- The type of the wrapped data of the tree node.
- All Implemented Interfaces:
Serializable,Comparable<T>,Iterable<TreeModel<T>>,TreeModel<T>
public class SortedTreeModel<T> extends AbstractTreeModel<T> implements Comparable<T>
- Since:
- 1.7
- Author:
- Bauke Scholtz
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SortedTreeModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreeModel<T>addChild(T data)An override which throwsIllegalArgumentExceptionwhen given data is notnulland not an instance ofComparable.intcompareTo(T object)protected Collection<TreeModel<T>>createChildren()Returns a newTreeSet.-
Methods inherited from class org.omnifaces.model.tree.AbstractTreeModel
addChildNode, equals, getChildCount, getChildren, getData, getIndex, getLevel, getNextSibling, getParent, getPreviousSibling, hashCode, isFirst, isLast, isLeaf, isRoot, iterator, remove, setData, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
createChildren
protected Collection<TreeModel<T>> createChildren()
Returns a newTreeSet.- Specified by:
createChildrenin classAbstractTreeModel<T>- Returns:
- A concrete (and usually empty)
Collectioninstance which should hold the tree's children.
-
addChild
public TreeModel<T> addChild(T data)
An override which throwsIllegalArgumentExceptionwhen given data is notnulland not an instance ofComparable. In other words, it only acceptsnullor an instance ofComparable.
-
compareTo
public int compareTo(T object)
- Specified by:
compareToin interfaceComparable<T>
-
-