com.metamatrix.platform.admin.api
Interface PermissionTreeView

All Known Subinterfaces:
PermissionDataNodeTreeView
All Known Implementing Classes:
PermissionDataNodeTreeViewImpl

public interface PermissionTreeView


Method Summary
 java.util.Iterator breadthFirstIterator()
          Obtain a breadth-first Iterator over the whole tree starting at the root.
 java.util.Iterator breadthFirstIterator(PermissionNode startingPoint)
          Obtain a breadth-first Iterator starting at the given node.
 java.util.List getChildren(PermissionNode parent)
          Obtain the set of entries that are considered the children of the specified PermissionDataNode.
 java.util.List getDescendants(PermissionNode startingPoint)
          Obtain all the PermissionDataNodes in the tree under the given node.
 java.util.Set getMarked()
          Obtain all the marked PermissionDataNodes in the tree.
 java.util.Set getMarkedDescendants(PermissionNode startingPoint)
          Obtain all the marked PermissionDataNodes in the tree under the given node.
 java.util.List getModified()
          Obtain all the modified PermissionDataNodes in the tree.

This method will get hidden nodes if showHidden == true.
 java.util.List getModifiedBreadthFirst()
          Obtain the modified PermissionDataNodes closest to the root in the tree.
 java.util.List getModifiedDescendants(PermissionNode startingPoint)
          Obtain all the modified PermissionDataNodes in the tree under the given node.
 PermissionNode getParent(PermissionNode entry)
          Determine the parent PermissionDataNode for the specified entry, or null if the specified entry is a root.
 PermissionNode getRoot()
          Obtain the root PermissionDataNode of the tree.
 java.util.List getRoots()
          Obtain a list of PermissionDataNodes which are the children of the root.
 java.util.List getUnModifiedDescendants(PermissionNode startingPoint)
          Obtain all the unmodified PermissionDataNodes in the tree under the given node.
 boolean isDescendantOf(PermissionNode ancestor, PermissionNode descendant)
          Determine whether the given descendant is a descendant of the given ancestor.

This method will check all descendants of the ancester, even if they are marked hidden.
 java.util.Iterator iterator()
          Obtain a depth-first Iterator over the whole tree starting at the root.
 java.util.Iterator iterator(PermissionNode startingPoint)
          Obtain a depth-first Iterator starting at the given node.
 void resetTree()
          Reset all tree nodes to their original AuthorizationActions values.
 void setBranchHidden(PermissionNode startingPoint)
          Set the subtree rooted at this node as hidden.
 void setMarked(PermissionNode entry, boolean markedState)
          (Un)Mark this node.
 void setShowHidden(boolean showHidden)
          Determines whether methods in this class return hidden nodes in results.
 

Method Detail

resetTree

void resetTree()
Reset all tree nodes to their original AuthorizationActions values.


setShowHidden

void setShowHidden(boolean showHidden)
Determines whether methods in this class return hidden nodes in results. The state can be toggled on or off as needed. The default is false (don't show hidden nodes).

Parameters:
showHidden - If true, hidden nodes will be returned in results, if false, they will not.

setMarked

void setMarked(PermissionNode entry,
               boolean markedState)
(Un)Mark this node.

Parameters:
entry - The node to mark or unmark.
markedState - If true, the node will be marked, if false, the node will be unmarked.

setBranchHidden

void setBranchHidden(PermissionNode startingPoint)
Set the subtree rooted at this node as hidden.

Parameters:
entry - The node to mark or unmark.
See Also:
setShowHidden

iterator

java.util.Iterator iterator(PermissionNode startingPoint)
Obtain a depth-first Iterator starting at the given node.

Returns:
The iterator.

iterator

java.util.Iterator iterator()
Obtain a depth-first Iterator over the whole tree starting at the root.

Returns:
The iterator.

breadthFirstIterator

java.util.Iterator breadthFirstIterator(PermissionNode startingPoint)
Obtain a breadth-first Iterator starting at the given node.

Returns:
The iterator.

breadthFirstIterator

java.util.Iterator breadthFirstIterator()
Obtain a breadth-first Iterator over the whole tree starting at the root.

Returns:
The iterator.

getRoot

PermissionNode getRoot()
Obtain the root PermissionDataNode of the tree. The root of this tree is always hidden but will always be returned even if the state of showHidden is false.

Returns:
The root of the tree.

getRoots

java.util.List getRoots()
Obtain a list of PermissionDataNodes which are the children of the root. These nodes are the real roots of the tree, since the root is just a placeholder that holds the real roots.

Returns:
The list of PermissionDataNodes that are the roots of the forest.

getParent

PermissionNode getParent(PermissionNode entry)
Determine the parent PermissionDataNode for the specified entry, or null if the specified entry is a root.

Parameters:
entry - the PermissionDataNode instance for which the parent is to be obtained; may not be null
Returns:
the parent entry, or null if there is no parent

getChildren

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

Parameters:
parent - the PermissionDataNode instance for which the child entries are to be obtained; may not be null
Returns:
the unmodifiable list of PermissionDataNode instances that are considered the children of the specified entry; never null but possibly empty

isDescendantOf

boolean isDescendantOf(PermissionNode ancestor,
                       PermissionNode descendant)
Determine whether the given descendant is a descendant of the given ancestor.

This method will check all descendants of the ancester, even if they are marked hidden.

Parameters:
ancestor - The node to check to see if it is an ancestor of the descendant.
descendant - The node to check to see if it is a descendant ancestor.
Returns:
true if ancestor is the ancestor of descendant.

getMarked

java.util.Set getMarked()
Obtain all the marked PermissionDataNodes in the tree. Note that the nodes are not nessesarily in tree form. They are just a collection of nodes.

This method will get hidden nodes if showHidden == true.

Returns:
The Set of all marked nodes in the tree.

getMarkedDescendants

java.util.Set getMarkedDescendants(PermissionNode startingPoint)
Obtain all the marked PermissionDataNodes in the tree under the given node. Note that the nodes are not nessesarily in tree form. They are just a collection of nodes.

This method will get hidden nodes if showHidden == true.

Returns:
The Set of all marked nodes in the tree below startingPoint.

getDescendants

java.util.List getDescendants(PermissionNode startingPoint)
Obtain all the PermissionDataNodes in the tree under the given node.

This method will get hidden nodes if showHidden == true.

Parameters:
startingPoint - The point in the tree to start the search for descendants.
Returns:
The List of all nodes in the tree below startingPoint.

getModified

java.util.List getModified()
Obtain all the modified PermissionDataNodes in the tree.

This method will get hidden nodes if showHidden == true.

Returns:
The List of all modified nodes in the tree.

getModifiedBreadthFirst

java.util.List getModifiedBreadthFirst()
Obtain the modified PermissionDataNodes closest to the root in the tree.

This method will get hidden nodes if showHidden == true.

Returns:
The List of all top level modified nodes in the tree.

getModifiedDescendants

java.util.List getModifiedDescendants(PermissionNode startingPoint)
Obtain all the modified PermissionDataNodes in the tree under the given node. Note that the nodes are not nessesarily in tree form.

This method will get hidden nodes if showHidden == true.

Returns:
The List of all modified nodes in the tree below startingPoint.

getUnModifiedDescendants

java.util.List getUnModifiedDescendants(PermissionNode startingPoint)
Obtain all the unmodified PermissionDataNodes in the tree under the given node. Note that the nodes are not nessesarily in tree form.

This method will get hidden nodes if showHidden == true.

Returns:
The List of all unmodified nodes in the tree below startingPoint.


Copyright © 2009. All Rights Reserved.