com.metamatrix.common.tree.basic
Class BasicTreeNodeSource

java.lang.Object
  extended by com.metamatrix.common.tree.basic.BasicTreeNodeSource
All Implemented Interfaces:
TreeNodeSource

public class BasicTreeNodeSource
extends java.lang.Object
implements TreeNodeSource

This interface defines an interface to a source of TreeNode information.


Constructor Summary
BasicTreeNodeSource(ObjectIDFactory idFactory)
           
BasicTreeNodeSource(ObjectIDFactory idFactory, PropertyAccessPolicy policy, UserTransactionFactory txnFactory)
           
BasicTreeNodeSource(ObjectIDFactory idFactory, UserTransactionFactory txnFactory)
           
 
Method Summary
 boolean allowsChild(TreeNode parent, TreeNode potentialChild)
          Determine whether the specified parent TreeNode may contain the specified child node.
 boolean allowsChildren(TreeNode node)
          Determine whether the specified TreeNode may contain children.
protected  BasicTreeNode assertBasicTreeNode(TreeNode node)
           
 TreeNodeEditor createTreeNodeEditor()
          Create a new instance of TreeNodeEditor, which is an editor that may be used to access and/or modify a single TreeNode object.
 java.util.List getChildren(TreeNode parent)
          Obtain the set of entries that are considered the children of the specified TreeNode.
 ObjectIDFactory getObjectIDFactory()
          Return the ObjectIDFactory instance for this TreeNodeSource
 TreeNode getParent(TreeNode node)
          Determine the parent TreeNode for the specified entry, or null if the specified entry is a root.
 PropertyAccessPolicy getPropertyAccessPolicy()
          Return the PropertyAccessPolicy instance for this TreeNodeSource
 UserTransactionFactory getUserTransactionFactory()
          Return the UserTransactionFactory instance for this TreeNodeSource
 boolean isAncestorOf(TreeNode ancestor, TreeNode descendent)
          Determine whether the specified node is a descendent of the given ancestor node.
 boolean isParentOf(TreeNode parent, TreeNode child)
          Determine whether the specified node is a child of the given parent node.
 boolean isReadOnly(TreeNode node)
          Determine whether the specified TreeNode is considered read-only
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicTreeNodeSource

public BasicTreeNodeSource(ObjectIDFactory idFactory)

BasicTreeNodeSource

public BasicTreeNodeSource(ObjectIDFactory idFactory,
                           UserTransactionFactory txnFactory)

BasicTreeNodeSource

public BasicTreeNodeSource(ObjectIDFactory idFactory,
                           PropertyAccessPolicy policy,
                           UserTransactionFactory txnFactory)
Method Detail

assertBasicTreeNode

protected BasicTreeNode assertBasicTreeNode(TreeNode node)

getChildren

public java.util.List getChildren(TreeNode parent)
Obtain the set of entries that are considered the children of the specified TreeNode.

Specified by:
getChildren in interface TreeNodeSource
Parameters:
parent - the TreeNode instance for which the child entries are to be obtained; may not be null
Returns:
the list of TreeNode instances that are considered the children of the specified entry; never null but possibly empty

getParent

public TreeNode getParent(TreeNode node)
Determine the parent TreeNode for the specified entry, or null if the specified entry is a root.

Specified by:
getParent in interface TreeNodeSource
Parameters:
entry - the TreeNode instance for which the parent is to be obtained; may not be null
Returns:
the parent entry, or null if there is no parent

createTreeNodeEditor

public TreeNodeEditor createTreeNodeEditor()
Create a new instance of TreeNodeEditor, which is an editor that may be used to access and/or modify a single TreeNode object.

Specified by:
createTreeNodeEditor in interface TreeNodeSource
Returns:
the new editor instance; never null

allowsChildren

public boolean allowsChildren(TreeNode node)
Determine whether the specified TreeNode may contain children.

Specified by:
allowsChildren in interface TreeNodeSource
Parameters:
entry - the TreeNode instance that is to be checked; may not be null
Returns:
true if the entry can contain children, or false otherwise.

allowsChild

public boolean allowsChild(TreeNode parent,
                           TreeNode potentialChild)
Determine whether the specified parent TreeNode may contain the specified child node.

Parameters:
parent - the TreeNode instance that is to be the parent; may not be null
potentialChild - the TreeNode instance that is to be the child; may not be null
Returns:
true if potentialChild can be placed as a child of parent, or false otherwise.

isParentOf

public boolean isParentOf(TreeNode parent,
                          TreeNode child)
Determine whether the specified node is a child of the given parent node.

Specified by:
isParentOf in interface TreeNodeSource
Returns:
true if the node is a child of the given parent node.

isAncestorOf

public boolean isAncestorOf(TreeNode ancestor,
                            TreeNode descendent)
Determine whether the specified node is a descendent of the given ancestor node.

Specified by:
isAncestorOf in interface TreeNodeSource
Returns:
true if the node is a descendent of the given ancestor node.

isReadOnly

public boolean isReadOnly(TreeNode node)
Determine whether the specified TreeNode is considered read-only

Specified by:
isReadOnly in interface TreeNodeSource
Parameters:
entry - the TreeNode instance that is to be checked; may not be null
Returns:
true if the entry is read-only, or false otherwise.

getObjectIDFactory

public ObjectIDFactory getObjectIDFactory()
Return the ObjectIDFactory instance for this TreeNodeSource


getPropertyAccessPolicy

public PropertyAccessPolicy getPropertyAccessPolicy()
Return the PropertyAccessPolicy instance for this TreeNodeSource


getUserTransactionFactory

public UserTransactionFactory getUserTransactionFactory()
Return the UserTransactionFactory instance for this TreeNodeSource



Copyright © 2009. All Rights Reserved.