Package org.zkoss.pivot.impl
Class SimplePivotHeaderTree
- java.lang.Object
-
- org.zkoss.pivot.impl.SimplePivotHeaderTree
-
- All Implemented Interfaces:
PivotHeaderTree
public class SimplePivotHeaderTree extends Object implements PivotHeaderTree
A simple implementation of PivotHeaderTree- Author:
- simonpai
-
-
Constructor Summary
Constructors Constructor Description SimplePivotHeaderTree(PivotField[] fields)
Construct an empty tree
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDepth()
Returns the depth of the tree.SimplePivotHeaderNode
getRoot()
Returns the root of the tree.void
sort()
Sort the tree nodes by node keys, using natural ordering.void
sort(Comparator<PivotHeaderNode> comparator)
Sort the tree nodes by node keys, using given comparator
-
-
-
Constructor Detail
-
SimplePivotHeaderTree
public SimplePivotHeaderTree(PivotField[] fields)
Construct an empty tree- Parameters:
fields
- the fields of each level
-
-
Method Detail
-
sort
public void sort()
Sort the tree nodes by node keys, using natural ordering.
-
sort
public void sort(Comparator<PivotHeaderNode> comparator)
Sort the tree nodes by node keys, using given comparator
-
getDepth
public int getDepth()
Description copied from interface:PivotHeaderTree
Returns the depth of the tree.- Specified by:
getDepth
in interfacePivotHeaderTree
-
getRoot
public SimplePivotHeaderNode getRoot()
Description copied from interface:PivotHeaderTree
Returns the root of the tree.- Specified by:
getRoot
in interfacePivotHeaderTree
- See Also:
PivotHeaderNode
-
-