org.omnaest.utils.structure.hierarchy.tree.object
Class ObjectToTreeNodeAdapter

java.lang.Object
  extended by org.omnaest.utils.structure.hierarchy.tree.object.ObjectToTreeNodeAdapter
All Implemented Interfaces:
ObjectTree, ObjectTreeNode, Tree<ObjectTreeNode.ObjectModel,ObjectTreeNode>, TreeNode<ObjectTreeNode.ObjectModel>

public class ObjectToTreeNodeAdapter
extends Object
implements ObjectTreeNode, ObjectTree

Adapter to make any Object available as ObjectTreeNode. Implements additionally the ObjectTree interface.

Author:
Omnaest
See Also:
ObjectTreeNode, ObjectTree

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.omnaest.utils.structure.hierarchy.tree.object.ObjectTreeNode
ObjectTreeNode.ObjectModel
 
Field Summary
protected  ObjectTreeNode.ObjectModel objectModel
           
 
Constructor Summary
ObjectToTreeNodeAdapter(Object object)
           
ObjectToTreeNodeAdapter(ObjectTreeNode.ObjectModel objectModel)
           
 
Method Summary
 boolean equals(Object obj)
           
 List<TreeNode<ObjectTreeNode.ObjectModel>> getChildrenList()
          Returns the List of references to the children of the current TreeNode
 ObjectTreeNode.ObjectModel getModel()
          Returns the data model which belongs to the current TreeNode
 ObjectTreeNode getTreeRootNode()
          Returns the single root TreeNode
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

objectModel

protected final ObjectTreeNode.ObjectModel objectModel
Constructor Detail

ObjectToTreeNodeAdapter

public ObjectToTreeNodeAdapter(ObjectTreeNode.ObjectModel objectModel)
Parameters:
objectModel -
See Also:
ObjectToTreeNodeAdapter

ObjectToTreeNodeAdapter

public ObjectToTreeNodeAdapter(Object object)
Parameters:
object -
See Also:
ObjectToTreeNodeAdapter
Method Detail

getModel

public ObjectTreeNode.ObjectModel getModel()
Description copied from interface: TreeNode
Returns the data model which belongs to the current TreeNode

Specified by:
getModel in interface Tree<ObjectTreeNode.ObjectModel,ObjectTreeNode>
Specified by:
getModel in interface TreeNode<ObjectTreeNode.ObjectModel>
Returns:

getChildrenList

public List<TreeNode<ObjectTreeNode.ObjectModel>> getChildrenList()
Description copied from interface: TreeNode
Returns the List of references to the children of the current TreeNode

Specified by:
getChildrenList in interface TreeNode<ObjectTreeNode.ObjectModel>
Returns:

getTreeRootNode

public ObjectTreeNode getTreeRootNode()
Description copied from interface: Tree
Returns the single root TreeNode

Specified by:
getTreeRootNode in interface Tree<ObjectTreeNode.ObjectModel,ObjectTreeNode>
Returns:

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013. All Rights Reserved.