java.io.Serializable, java.lang.Cloneable, javax.swing.tree.TreeNode, TreeNodeWithChangeSupportpublic class TreeNodeAdapter extends AbstractTreeNode
This class is a wrapper element for any Object that should be linked
into a tree data structure as represented by AbstractTreeNode, but
that might by itself not be an instance of TreeNode, i.e., not
compatible with the remaining tree data structure. In analogy to
MutableTreeNode we call this Object userObject
(see getUserObject() and setUserObject(Object)).
This wrapper distinguishes the following special cases depending on the type
of userObject when accessing the ith child of this
TreeNode. The userObject is an instance of
TreeNode: recursive operations are continued at this elementCollection: recursion leads to the ith element in the
IteratorMap: the key set is sorted (only possible if the keys implement
the Comparable interface) and recursion continues at the ith key.| Constructor | Description |
|---|---|
TreeNodeAdapter(java.lang.Object userObject,
javax.swing.tree.TreeNode parent) |
Creates a new
TreeNode wrapper for the given userObject
that will be linked to the given AbstractTreeNode.parent within an exisiting
tree. |
TreeNodeAdapter(TreeNodeAdapter node) |
Copy constructor for the given node.
|
| Modifier and Type | Method | Description |
|---|---|---|
javax.swing.tree.TreeNode |
clone() |
|
boolean |
equals(java.lang.Object object) |
|
boolean |
getAllowsChildren() |
|
javax.swing.tree.TreeNode |
getChildAt(int childIndex) |
|
int |
getChildCount() |
|
java.lang.Object |
getUserObject() |
|
int |
hashCode() |
|
boolean |
isSetUserObject() |
|
boolean |
isUserObjectRecursiveDataType() |
Checks whether or not the user's object has been set (see
isSetUserObject()) and if so if it belongs to those elements
returned by the method getChildAt(int). |
void |
setUserObject(java.lang.Object object) |
|
java.lang.String |
toString() |
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getParent, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySetpublic TreeNodeAdapter(java.lang.Object userObject,
javax.swing.tree.TreeNode parent)
TreeNode wrapper for the given userObject
that will be linked to the given AbstractTreeNode.parent within an exisiting
tree.userObject - the element to be wrapped in a TreeNode; may be null.parent - the parent TreeNode of this new node, i.e., the
position within an existing tree where to link this new node.
May be null.public TreeNodeAdapter(TreeNodeAdapter node)
node - public javax.swing.tree.TreeNode clone()
clone in class AbstractTreeNodepublic boolean equals(java.lang.Object object)
equals in class AbstractTreeNodepublic boolean getAllowsChildren()
public javax.swing.tree.TreeNode getChildAt(int childIndex)
public int getChildCount()
public java.lang.Object getUserObject()
public int hashCode()
hashCode in class AbstractTreeNodepublic boolean isSetUserObject()
public boolean isUserObjectRecursiveDataType()
isSetUserObject()) and if so if it belongs to those elements
returned by the method getChildAt(int).true if the user's object has been defined and
belongs to those classes that are returned by the method
getChildAt(int).getChildAt(int),
isSetUserObject()public void setUserObject(java.lang.Object object)
object - public java.lang.String toString()
toString in class AbstractTreeNode