| java.lang.Object com.Yasna.forum.database.DbTreeWalker
DbTreeWalker | public class DbTreeWalker implements TreeWalker(Code) | | Database implementation of the TreeWalker interface. This class is relatively
inefficient compared to how it will eventually be implemented. However,
a schema change is needed before that optimization is needed (represent
tree structure directly in schema).
|
getChild | public ForumMessage getChild(ForumMessage parent, int index)(Code) | | Returns the child of parent at index index in the parent's child array.
This should not return null if index is a valid index for parent (that
is index >= 0 && index < getChildCount(parent)).
Parameters: parent - the parent message. Parameters: index - the index of the child. |
getChildCount | public int getChildCount(ForumMessage parent)(Code) | | Returns the number of children of parent. Returns 0 if the node is a
leaf or if it has no children.
Parameters: parent - a node in the tree, obtained from this data source. |
getRecursiveChildCount | public int getRecursiveChildCount(ForumMessage parent)(Code) | | Returns the total number of recursive children of a parent. Returns 0
if there are no children. This method is not intended to aid in
navigation of a Thread but is included as an added utility.
|
getRoot | public ForumMessage getRoot()(Code) | | Returns the root of the tree. Returns null only if the tree has no nodes.
|
isLeaf | public boolean isLeaf(ForumMessage node)(Code) | | Returns true if node is a leaf. A node is a leaf when it has no children
messages.
Parameters: node - a node in the tree, obtained from this data source |
|
|