com.iplanet.jato.model
Class TestTreeModelImpl

java.lang.Object
  |
  +--com.iplanet.jato.model.TreeModelBase
        |
        +--com.iplanet.jato.model.TestTreeModelImpl
All Implemented Interfaces:
Model, TreeModel

public class TestTreeModelImpl
extends TreeModelBase

A simple TreeModel implementation that can be used for quick testing and diagnostics. This class may disappear in later versions of the framework.

Version:
JATO/1.2.2 $Id: TestTreeModelImpl.java,v 1.12 2002/03/16 03:26:32 todd Exp $

Fields inherited from interface com.iplanet.jato.model.TreeModel
BREADTH_FIRST_TRAVERSAL, DEPTH_FIRST_TRAVERSAL, NEXT_CHILD, NEXT_SIBLING, ROOT_NODE_LEVEL, UNDEFINED_NODE_LEVEL
 
Constructor Summary
TestTreeModelImpl()
           
TestTreeModelImpl(java.lang.String name)
           
 
Method Summary
 void beforeRoot()
          In addition to making the root node the next available node, this method should set the node level to UNDEFINED_NODE_LEVEL and call setIterationComplete(false) if there are children available to iterator over
 boolean firstChild()
          / public abstract boolean previousNode() throws ModelControlException; /** The implementation of this method should call incrementNodeLevel()
 java.lang.String getName()
          Returns the logical instance name of this model.
 java.lang.String getNodeID()
          Return a unique ID for the current node within the backing data structure.
 java.lang.String getNodeName()
          Return the logical name of the current node
 java.lang.String getNodeType()
          Return the logical type of the current node
 java.lang.Object getValue(java.lang.String name)
          Unilaterally returns a diagnostic name for the current node
 java.lang.Object[] getValues(java.lang.String name)
          Unilaterally returns a single diagnostic name for the current node
 boolean isChildNode()
          Check if the current node is a child of a parent node
 boolean isParentNode()
          Check if the current node is a parent of other nodes
 boolean nextSibling()
          The implementation of this method should leave the node level unchanged
 boolean parent()
          The implementation of this method should call decrementNodeLevel()
 void root()
          In addition to making the root node the current node, this method should set the node level to ROOT_NODE_LEVEL
 void setName(java.lang.String value)
          Sets the logical name of this model
 void setValue(java.lang.String name, java.lang.Object value)
          Currently unsupported; implementation is no-op
 void setValues(java.lang.String name, java.lang.Object[] values)
          Currently unsupported; implementation is no-op
 
Methods inherited from class com.iplanet.jato.model.TreeModelBase
clearCurrentNode, decrementNodeLevel, getCurrentNode, getNodeLevel, getTraversalType, incrementNodeLevel, isIterationComplete, nextNode, nextNode, setCurrentNode, setIterationComplete, setNodeLevel, setTraversalType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestTreeModelImpl

public TestTreeModelImpl()

TestTreeModelImpl

public TestTreeModelImpl(java.lang.String name)
Method Detail

beforeRoot

public void beforeRoot()
                throws ModelControlException
Description copied from class: TreeModelBase
In addition to making the root node the next available node, this method should set the node level to UNDEFINED_NODE_LEVEL and call setIterationComplete(false) if there are children available to iterator over
Overrides:
beforeRoot in class TreeModelBase

root

public void root()
          throws ModelControlException
Description copied from class: TreeModelBase
In addition to making the root node the current node, this method should set the node level to ROOT_NODE_LEVEL
Overrides:
root in class TreeModelBase

getNodeName

public java.lang.String getNodeName()
                             throws ModelControlException
Description copied from interface: TreeModel
Return the logical name of the current node
Overrides:
getNodeName in class TreeModelBase

getNodeType

public java.lang.String getNodeType()
                             throws ModelControlException
Description copied from interface: TreeModel
Return the logical type of the current node
Overrides:
getNodeType in class TreeModelBase

getNodeID

public java.lang.String getNodeID()
Description copied from interface: TreeModel
Return a unique ID for the current node within the backing data structure. This ID should unambiguously identify the current node within the entire model. In some model implementations and usages, this ID will need to unambiguously identify the node across requests, and even across instantiations of the model instances. In some cases, a fully qualified path to the node will be sufficient; in other cases, a more unique identifier, possible assigned by the model, will be required.
Overrides:
getNodeID in class TreeModelBase

isParentNode

public boolean isParentNode()
Description copied from interface: TreeModel
Check if the current node is a parent of other nodes
Overrides:
isParentNode in class TreeModelBase

isChildNode

public boolean isChildNode()
Description copied from interface: TreeModel
Check if the current node is a child of a parent node
Overrides:
isChildNode in class TreeModelBase

firstChild

public boolean firstChild()
                   throws ModelControlException
Description copied from class: TreeModelBase
/ public abstract boolean previousNode() throws ModelControlException; /** The implementation of this method should call incrementNodeLevel()
Overrides:
firstChild in class TreeModelBase

parent

public boolean parent()
               throws ModelControlException
Description copied from class: TreeModelBase
The implementation of this method should call decrementNodeLevel()
Overrides:
parent in class TreeModelBase

nextSibling

public boolean nextSibling()
                    throws ModelControlException
Description copied from class: TreeModelBase
The implementation of this method should leave the node level unchanged
Overrides:
nextSibling in class TreeModelBase

getName

public java.lang.String getName()
Description copied from interface: Model
Returns the logical instance name of this model. This name can be any arbitrary string. This name may only be useful at certain times; for example, the ModelManager may assign a name to a model based on user request.
Following copied from interface: com.iplanet.jato.model.Model
Returns:
The opaque, arbitrary name of this model

setName

public void setName(java.lang.String value)
Description copied from interface: Model
Sets the logical name of this model
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The new name of this model

getValue

public java.lang.Object getValue(java.lang.String name)
Unilaterally returns a diagnostic name for the current node
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value to return
Returns:
The specified value. If the model has multiple values for the specified name, the first value is returned. If there is no value for the specified name, this method returns null.

setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
              throws ValidationException
Currently unsupported; implementation is no-op
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value to set
value - The value to set in this model

getValues

public java.lang.Object[] getValues(java.lang.String name)
Unilaterally returns a single diagnostic name for the current node
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value set to return
Returns:
The specified set of values. If there is no value for the specified name, this method returns an array of zero length.

setValues

public void setValues(java.lang.String name,
                      java.lang.Object[] values)
               throws ValidationException
Currently unsupported; implementation is no-op
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value set to set in the model
values - The set of values to set in this model