com.sri.emo.dbobj.selectiontree
Class TagSelectionFactory

java.lang.Object
  extended by com.sri.emo.dbobj.selectiontree.TagSelectionFactory

public class TagSelectionFactory
extends Object

Selects a tree of nodes where the root node(s) have a given tag. Each child node from the root is included in the tree if it has a strong relationship with its parent.

Author:
Larry Hamel

Field Summary
static String IS_PARENT_OF
           
 
Constructor Summary
TagSelectionFactory(String[] tags)
           
 
Method Summary
 Map getNodesInTree()
          Get ALL related nodes in tree beneath tagged node(s).
 Node[] getTaggedNodes()
          Get nodes in with given tag.
 String[] getTags()
          Retrieve the tags we're looking to handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_PARENT_OF

public static final String IS_PARENT_OF
See Also:
Constant Field Values
Constructor Detail

TagSelectionFactory

public TagSelectionFactory(String[] tags)
Method Detail

getTags

public String[] getTags()
Retrieve the tags we're looking to handle.

Returns:

getTaggedNodes

public Node[] getTaggedNodes()
                      throws DBException
Get nodes in with given tag.

Returns:
array of Node instances; never null
Throws:
DBException

getNodesInTree

public Map getNodesInTree()
                   throws DBException
Get ALL related nodes in tree beneath tagged node(s).

side-effect: adds attribute 'level' with node level w/i tree to each node. side-effect: adds attribute 'MyChildren' with array of Nodes of all children

uses optional INDENT attribute to determine formatting indentation

side-effect of an attribute on each node that is array of all immediate children. (null if none)

Returns:
Map keyed by node id, pointing to the nodes in the tree; never null
Throws:
DBException


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.