com.vinculumtech.carrierwave.plan
Class GraphNodeSet

java.lang.Object
  extended bycom.vinculumtech.carrierwave.plan.GraphNode
      extended bycom.vinculumtech.carrierwave.plan.GraphNodeSet
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class GraphNodeSet
extends GraphNode

GraphNodeSet provides for a set of related GraphNode instances to be specified as a single node in a node tree.

Each peer node added will be a "sub graph" node tree for the type it represents. It is expected all the peer nodes added will be subclasses of a common base type, typically represented by the defaultPeerNode.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/plan/GraphNodeSet.java#15 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.vinculumtech.carrierwave.plan.GraphNode
NO_INDEX, NO_KEY
 
Constructor Summary
GraphNodeSet()
           
GraphNodeSet(java.lang.String edge, boolean isReadOnly)
          Creates a new GraphNodeSet.
GraphNodeSet(java.lang.String edge, boolean isReadOnly, boolean isReferenceOnly)
           
 
Method Summary
 GraphNode addChildNode(GraphNode childNode)
          This method is not supported on a GraphNodeSet.
 GraphNode addPeerNode(GraphNode graphNode)
          Adds a new GraphNode instance as a peer node.
 java.util.List getChildren()
           
 GraphNode getDefaultPeerNode()
           
 java.util.List getPeerNodes()
          Returns all the peerNodes this set represents, including the default node.
 java.lang.String getTypeName()
          Returns the type of the default peer node.
 boolean hasChildren()
           
 boolean isNodeSet()
           
 GraphNode setDefaultPeerNode(GraphNode defaultPeerNode)
          Sets the defaultPeerNode.
 void setEdge(java.lang.String edge)
          Sets the edge on all the peer nodes.
 void setKey(java.lang.Object key)
          Sets the key on all the peer nodes.
protected  void setOriginNode(GraphNode originNode)
           
protected  void setParentNode(GraphNode parentNode)
           
 void setReadOnly(boolean isReadOnly)
          Sets all the peer nodes to read only.
 
Methods inherited from class com.vinculumtech.carrierwave.plan.GraphNode
clone, cloneShallow, findChildNodeWith, findChildNodeWith, getAllNodes, getAllParentNodes, getDepth, getEdge, getFullEdge, getGraphPlan, getIndex, getKey, getNodePath, getOriginNode, getOriginNodeOrThis, getParentNode, isContained, isContainer, isList, isLiteral, isMap, isOrigin, isReadOnly, isReferenceOnly, removeChildNode, resetIndex, resetKey, setGraphPlan, setIndex, setLiteral, setReferenceOnly, setTypeName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphNodeSet

public GraphNodeSet(java.lang.String edge,
                    boolean isReadOnly)
Creates a new GraphNodeSet. To properly initialize, add a defaultPeerNode and any number of peer GraphNode instances.

Parameters:
edge -
isReadOnly -

GraphNodeSet

public GraphNodeSet(java.lang.String edge,
                    boolean isReadOnly,
                    boolean isReferenceOnly)

GraphNodeSet

public GraphNodeSet()
Method Detail

isNodeSet

public boolean isNodeSet()
Overrides:
isNodeSet in class GraphNode
Returns:
true if this instance is a GraphNodeSet

getTypeName

public java.lang.String getTypeName()
Returns the type of the default peer node.

Overrides:
getTypeName in class GraphNode
Returns:

setDefaultPeerNode

public GraphNode setDefaultPeerNode(GraphNode defaultPeerNode)
Sets the defaultPeerNode.

Parameters:
defaultPeerNode -
Returns:

getDefaultPeerNode

public GraphNode getDefaultPeerNode()
Returns:
the defaultPeerNode

getPeerNodes

public java.util.List getPeerNodes()
Returns all the peerNodes this set represents, including the default node.

Returns:

addPeerNode

public GraphNode addPeerNode(GraphNode graphNode)
Adds a new GraphNode instance as a peer node.

Parameters:
graphNode -
Returns:

hasChildren

public boolean hasChildren()
Overrides:
hasChildren in class GraphNode
Returns:
true if any of the peer nodes have children

getChildren

public java.util.List getChildren()
Overrides:
getChildren in class GraphNode
Returns:
a List of all the peer node children

addChildNode

public GraphNode addChildNode(GraphNode childNode)
This method is not supported on a GraphNodeSet.

Overrides:
addChildNode in class GraphNode
Parameters:
childNode -
Returns:

setParentNode

protected void setParentNode(GraphNode parentNode)
Overrides:
setParentNode in class GraphNode
Parameters:
parentNode -

setOriginNode

protected void setOriginNode(GraphNode originNode)
Overrides:
setOriginNode in class GraphNode

setEdge

public void setEdge(java.lang.String edge)
Sets the edge on all the peer nodes.

Overrides:
setEdge in class GraphNode
Parameters:
edge -

setKey

public void setKey(java.lang.Object key)
Sets the key on all the peer nodes.

Overrides:
setKey in class GraphNode
Parameters:
key -

setReadOnly

public void setReadOnly(boolean isReadOnly)
Sets all the peer nodes to read only.

Overrides:
setReadOnly in class GraphNode
Parameters:
isReadOnly -


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.