public interface AreaTreeNode<T>
| Modifier and Type | Method and Description |
|---|---|
void |
addUserAttribute(Object attribute)
Sets a user-defined attribute for the tree node.
|
void |
appendChild(T child)
Appends a new child area to the list of child areas of this area.
|
void |
appendChildren(List<T> list)
Appends a list of child areas to the list of child areas of this area.
|
int |
getDepth()
Obtains the depth of the tree rooted at this area.
|
T |
getChildArea(int index)
Obtains the n-th child area.
|
List<T> |
getChildAreas()
Returns the list of all the child areas.
|
int |
getChildCount()
Returns the number of child areas for this area.
|
int |
getIndex(T child)
Returns the index of the specified child in this node's child array.
|
int |
getLeafCount()
Returns the total number of leaves that are descendants of this node.
|
T |
getNextSibling()
Obtains the next siblibg of this area.
|
T |
getParentArea()
Obtains the parent area of this area.
|
T |
getPreviousSibling()
Obtains the previous siblibg of this area.
|
<P> P |
getUserAttribute(Class<P> clazz)
Obtains the user-defined attributes of the node.
|
void |
insertChild(T child,
int index)
Inserts a new child at the given position.
|
boolean |
isAncestorOf(T other)
Check whether this area is an ancestor of another area.
|
boolean |
isLeaf()
Checks whether this area is a leaf area
|
void |
removeAllChildren()
Removes all the child areas from their parent.
|
void |
removeChild(T child)
Removes a child area from its parent.
|
T getParentArea()
null when this is the root area.T getPreviousSibling()
null when this is the first child.T getNextSibling()
null when this is the last child.T getChildArea(int index) throws ArrayIndexOutOfBoundsException
index - the child indexArrayIndexOutOfBoundsExceptionint getChildCount()
List<T> getChildAreas()
void appendChild(T child)
child - The new child to be appendedvoid appendChildren(List<T> list)
list - The list of new children to be appendedvoid insertChild(T child, int index)
child - the child to be insertedindex - the index of the new childvoid removeChild(T child)
child - The new child to be appendedvoid removeAllChildren()
int getIndex(T child)
child - the child node to searchboolean isLeaf()
true when the area is a leaf area (it has no children)boolean isAncestorOf(T other)
other - the other areatrue when this area is an ancestor of the other area.int getDepth()
int getLeafCount()
void addUserAttribute(Object attribute)
attribute - an object representing the user attributes (application-specific)<P> P getUserAttribute(Class<P> clazz)
clazz - the class of the required attributenull when no such attribute is present.Copyright © 2018. All rights reserved.