Interface TreeQuestion.Model
- Enclosing class:
TreeQuestion
public static interface TreeQuestion.Model
An interface that provides the model for the tree whose nodes
are selected by a TreeQuestion.
-
Method Summary
Modifier and TypeMethodDescriptionGet a child of a specified node, or null if no such child exists.intgetChildCount(Object node) Get the number of children of a specified node.Get the name of a specified node.Get the full path from the root node of a specified node.getRoot()Get the root node of the tree.booleanDetermine if this a node is a leaf node.
-
Method Details
-
getRoot
-
getChildCount
Get the number of children of a specified node.- Parameters:
node- the node for which to get the number of children- Returns:
- the number of children of the specified node
-
getChild
Get a child of a specified node, or null if no such child exists.- Parameters:
node- the node for which to get the childindex- the index of the child; this should be a number greater than or equal to zero and less than the number of children of the node.- Returns:
- the specified child, or null if index does not identify a valid child.
- See Also:
-
getName
-
getPath
-
isLeaf
Determine if this a node is a leaf node. This is primarily an attribute of the node's actual type, and is not necessarily the same as having zero children. (A leaf node implies zero children, but zero children does not imply a node is a leaf.)- Parameters:
node- the node to check for being a leaf- Returns:
- true if the specified node is a leaf node, and false otherwise.
-