com.sri.emo.dbobj.model_tree
Class AbstractModelNode

java.lang.Object
  extended by com.sri.emo.dbobj.model_tree.AbstractModelNode
All Implemented Interfaces:
ModelNode, MutableModelNode
Direct Known Subclasses:
DefaultModelNode

public abstract class AbstractModelNode
extends Object
implements MutableModelNode

Simple base class of all the mutable nodes. Allows for adding and subtracting any types of nodes we wish. Just derive to add your specific type and factory.

Author:
Michael Rimov

Field Summary
 
Fields inherited from interface com.sri.emo.dbobj.model_tree.ModelNode
NO_CHILDREN, NO_LINK, NO_PARENT
 
Constructor Summary
AbstractModelNode()
          Constructor for when there is no parent.
AbstractModelNode(MutableModelNode nodeParent)
          Constructor for when we want to attach to a parent.
 
Method Summary
 void addChild(ModelNode newNode)
          Add a child node to the given mutable model.
 List getChildren()
          Retrieve the items in the composite model.
 String getLabel()
          Retrieve the label assigned to the node.
 Transition getLink()
          Retrieve the edit link
 ModelNode getParent()
          Retrieves the parent or returns NO_PARENT if we are already at the top of the node.
 Iterator iterator()
          Allows for iteration of the contents of the node, possibly removing them if the iterator supports removal.
 void setLabel(String label)
          Set the label of the node.
 void setLink(Transition link)
          Set the transition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sri.emo.dbobj.model_tree.ModelNode
getAdditionalInfo, getModelFillStatus, getNodeCompletionStatus, getVisitable, setAdditionalInfo
 

Constructor Detail

AbstractModelNode

public AbstractModelNode()
Constructor for when there is no parent.


AbstractModelNode

public AbstractModelNode(MutableModelNode nodeParent)
Constructor for when we want to attach to a parent. The parent node automatically receives the addChild() message from this object.

Parameters:
nodeParent - MutableModelNode
Method Detail

addChild

public void addChild(ModelNode newNode)
Add a child node to the given mutable model.

Specified by:
addChild in interface MutableModelNode
Parameters:
newNode - ModelCompositeNode
To Do:
Implement this com.sri.emo.dbobj.model_tree.MutableModelNode method

getChildren

public List getChildren()
Retrieve the items in the composite model.

Specified by:
getChildren in interface ModelNode
Returns:
a list of ModelComposite objects or NO_CHILDREN if this is a leaf node.

getParent

public ModelNode getParent()
Retrieves the parent or returns NO_PARENT if we are already at the top of the node.

Specified by:
getParent in interface ModelNode
Returns:
ModelCompositeNode or NO_PARENT.

iterator

public Iterator iterator()
Allows for iteration of the contents of the node, possibly removing them if the iterator supports removal.

Specified by:
iterator in interface MutableModelNode
Returns:
Iterator that returns MutableModelNode instances.

getLabel

public String getLabel()
Retrieve the label assigned to the node.

Specified by:
getLabel in interface ModelNode
Returns:
String label.

getLink

public Transition getLink()
Retrieve the edit link

Specified by:
getLink in interface ModelNode
Returns:
String

setLabel

public void setLabel(String label)
Set the label of the node.

Parameters:
label - String

setLink

public void setLink(Transition link)
Set the transition.

Parameters:
link - Transition


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