|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.proxy.TreeWalkerProxy
public class TreeWalkerProxy
Protection proxy for TreeWalker ojbects.
Constructor Summary | |
---|---|
TreeWalkerProxy(TreeWalker treeWalker,
AuthToken authToken,
Permissions permissions)
|
Method Summary | |
---|---|
ForumMessage |
getChild(ForumMessage parent,
int index)
Returns the child of parent at index index in the parent's child array. |
int |
getChildCount(ForumMessage parent)
Returns the number of children of parent. |
java.util.Iterator |
getChildren(ForumMessage parent)
Returns an Iterator for all the child messages of the parent. |
int |
getIndexOfChild(ForumMessage parent,
ForumMessage child)
Returns the index of child in parent. |
int |
getMessageDepth(ForumMessage message)
Returns the depth of a message in the message tree hierarchy. |
ForumMessage |
getParent(ForumMessage child)
Returns the parent of the child ForumMessage. |
int |
getRecursiveChildCount(ForumMessage parent)
Returns the total number of recursive children of a parent. |
java.util.Iterator |
getRecursiveChildren(ForumMessage parent)
Returns an Iterator for all child messages (and sub-children, etc) of the parent. |
java.util.Iterator |
getRecursiveMessages()
Returns an Iterator for all messages in the thread in depth-first order. |
ForumMessage |
getRoot()
Returns the root of the tree. |
boolean |
hasParent(ForumMessage child)
Returns true if the child message has a parent message. |
boolean |
isLeaf(ForumMessage node)
Returns true if node is a leaf. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TreeWalkerProxy(TreeWalker treeWalker, AuthToken authToken, Permissions permissions)
Method Detail |
---|
public ForumMessage getRoot()
TreeWalker
getRoot
in interface TreeWalker
public boolean hasParent(ForumMessage child)
TreeWalker
child
message has a parent message.
hasParent
in interface TreeWalker
child
- the message.
public ForumMessage getParent(ForumMessage child) throws ForumMessageNotFoundException
TreeWalker
child
ForumMessage.
getParent
in interface TreeWalker
ForumMessageNotFoundException
- if child does not have a parent,
or if the parent message could not be loaded for any other reason.public ForumMessage getChild(ForumMessage parent, int index) throws ForumMessageNotFoundException
TreeWalker
index
>= 0, and
index
< getChildCount(parent). If the index is not valid,
or if the child could not be loaded for any other reason, a
ForumMessageNotFoundException will be thrown.
getChild
in interface TreeWalker
parent
- the parent message.index
- the index of the child.
ForumMessageNotFoundException
- if the index was invalid or the
child could not be loaded for any other reason.public java.util.Iterator getChildren(ForumMessage parent)
TreeWalker
TreeWalker.getRecursiveChildren(ForumMessage)
method.
getChildren
in interface TreeWalker
parent
- the parent message.
public java.util.Iterator getRecursiveMessages()
TreeWalker
1 |-- 3 |-- |-- 4 |-- |-- |-- 7 |-- |-- |-- |-- 10 |-- |-- 6 |-- |-- 8 |-- 5Calling getRecursiveMessages() on the tree above would return the sequence 1, 3, 4, 7, 10, 6, 8, 5. This method is a powerful way to show the full tree of messages, especially in combination with the
TreeWalker.getMessageDepth(ForumMessage)
method.
getRecursiveMessages
in interface TreeWalker
public java.util.Iterator getRecursiveChildren(ForumMessage parent)
TreeWalker
1 |-- 3 |-- |-- 4 |-- |-- |-- 7 |-- |-- |-- |-- 10 |-- |-- 6 |-- |-- 8 |-- 5Calling getRecursiveChildren(3) on the tree above would return the sequence 4, 7, 10, 6, 8. This method is a powerful way to show all children of a message, especially in combination with the
TreeWalker.getMessageDepth(ForumMessage)
method.
getRecursiveChildren
in interface TreeWalker
parent
- the parent message.
public int getMessageDepth(ForumMessage message)
TreeWalker
1 |-- 3 |-- |-- 4 |-- |-- |-- 7The depth of message 4 is 2, the depth of message 7 is 3, etc. This method is useful in combination with the
TreeWalker.getRecursiveChildren(ForumMessage)
Iterator to build a UI of hierarchical messages.
getMessageDepth
in interface TreeWalker
message
- the message to determine the depth of.
public int getChildCount(ForumMessage parent)
TreeWalker
getChildCount
in interface TreeWalker
parent
- a node in the tree, obtained from this data source.
public int getRecursiveChildCount(ForumMessage parent)
TreeWalker
getRecursiveChildCount
in interface TreeWalker
parent
.public int getIndexOfChild(ForumMessage parent, ForumMessage child)
TreeWalker
4 |-- 2 |-- |-- 1 |-- |-- 6 |-- |-- 8 |-- 5In this example, getIndexOfChild(4, 2) would return 0, getIndexOfChild(4, 5) would return 1, and getIndexOfChild(2, 8) would return 2. getIndexOfChild(4, 8) -- NOT VALID
getIndexOfChild
in interface TreeWalker
parent
- the parent message.child
- the child message to get the index for.
public boolean isLeaf(ForumMessage node)
TreeWalker
isLeaf
in interface TreeWalker
node
- a node in the tree, obtained from this data source
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |