|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface represents the functionality of any potential
vertex in a graph. We call this vertex a Node
because it tends to confuse fewer non-technical people who come
into contact with graph theory and this framework.
Constructing a Node (and its related objects) is done
by means of a GraphModelFactory,
which will hide the particular implementation classes from client code.
Implementations should not be coupled to any kind of visualization.
Node objects that are dereferenced will be garbage collected.
Two types of event listeners are available for notification. Instances of
NodeListener listen to events coming
from one Node object, while
GraphEventMediator instances listen to
events coming from an entire Graph tree. Any number of event
listeners may be added to a Node.
Additionally, there are corresponding vetoable listeners and mediators
defined in the event package of the API. These listeners and mediators
contain methods that are invoked prior to a specific event. By throwing
an exception, code can indicate that it would like to prevent a
specific event from happening, thereby sending a veto for the event.
These special listeners are
VetoableGraphListener
and
VetoableGraphEventMediatorListener.
Graph,
Edge,
GraphObject,
NodeListener| Field Summary |
| Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
TREE_SUBSET_POSTFIX |
| Method Summary | |
void |
addNodeListener(NodeListener listener)
Adds a NodeListener to this
Node. |
Node |
deepCopy()
Returns a deep copy of the node. |
java.util.List |
getAdjacentEdges()
Returns a list containing all adjacent edges of this node. |
java.util.List |
getAdjacentNodes()
Returns a list containing all adjacent nodes. |
int |
getDegree()
Returns the number of edges leaving this node added to the number of edges entering this node. |
java.util.List |
getInboundEdges()
Returns a list containing the incoming edges of this node. |
java.util.List |
getInboundNodes()
Returns a list containing the nodes connected via incoming edges. |
int |
getIndegree()
Returns the number of edges entering this node. |
NodeInfo |
getNodeInfo()
Returns the NodeInfo associated with this
Node. |
java.util.List |
getOutboundEdges()
Returns a list containing the outgoing edges of this node. |
java.util.List |
getOutboundNodes()
Returns a list containing the nodes connected via outgoing edges. |
int |
getOutdegree()
Returns the number of edges leaving this node. |
Port |
getPortByID(long id)
Returns the Port with the given id.
|
java.util.List |
getPorts()
Returns a list of the ports of this node. |
void |
internalResetPortNumbers()
Resets the ids of the ports. |
Edge |
isConnectedFromNode(Node node)
Determines whether this node is connected from the given node. |
Edge |
isConnectedToNode(Node node)
Determines whether this node is connected to the given node. |
void |
removeNodeListener(NodeListener listener)
Removes a NodeListener from this
Node. |
void |
setID(long id)
NOTE: This method is for internal use only and should never be invoked by the client. |
void |
setNodeInfo(NodeInfo nodeInfo)
Sets the NodeInfo associated with this
Node. |
void |
setPorts(java.util.List ports)
Sets the List of ports given by ports as the
new ports of this node. |
| Methods inherited from interface com.tensegrity.graph.model.GraphObject |
addCustomAttribute, assertCustomAttribute, assertCustomAttribute, fillInDump, getCustomAttributes, getDescription, getID, getLabel, getParentContainer, getUniqueID, registerEventMediator, registerEventMediatorInternal, registerVetoableEventMediator, removeCustomAttribute, setCustomAttributes, setDescription, setLabel |
| Methods inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
addAttributableOnSetListener, areAttributableEventsEnabled, disableAttributableEvents, enableAttributableEvents, getAttributes, getAttributesTree, removeAttributableOnSetListener, setAttributes, setAttributesTree |
| Methods inherited from interface com.tensegrity.generic.attribute.Attributable |
getAttribute, getAttributeType, getAttributeValue, setAttribute, setAttributeValue |
| Method Detail |
public int getDegree()
public int getIndegree()
GraphTypeException - thrown if the method is invoked
on an undirected graph.public int getOutdegree()
GraphTypeException - thrown if the method is invoked
on an undirected graph.public java.util.List getAdjacentEdges()
public java.util.List getAdjacentNodes()
public java.util.List getInboundEdges()
getIndegree().
GraphTypeException - thrown if the method is invoked
on an undirected graph.public java.util.List getOutboundEdges()
getOutdegree().
GraphTypeException - thrown if the method is invoked
on an undirected graph.public java.util.List getInboundNodes()
getIndegree(). All nodes in this operator are also indirectly
available by invoking the getInboundEdges method and then
invoking getTarget() on the obtained edges.
GraphTypeException - thrown if the method is invoked
on an undirected graph.public java.util.List getOutboundNodes()
getOutdegree(). All nodes in this operator are also indirectly
available by invoking the getOutboundEdges method and then
invoking getSource() on the obtained edges.
GraphTypeException - thrown if the method is invoked
on an undirected graph.public Edge isConnectedFromNode(Node node)
node - the node which is checked for connectivity.
public Edge isConnectedToNode(Node node)
node - the node which is checked for connectivity.
public NodeInfo getNodeInfo()
NodeInfo associated with this
Node.
NodeInfo associated with this
Node. The returned value may be null if no
info is associated with this Node.public void setNodeInfo(NodeInfo nodeInfo)
NodeInfo associated with this
Node.
nodeInfo - the NodeInfo to associate with this
Node.public Port getPortByID(long id)
Port with the given id.
If the Node has no Port with the given id
null is returned.
id - the id of the Port to return
Port specified through the given id or
nullpublic java.util.List getPorts()
public void setPorts(java.util.List ports)
List of ports given by ports as the
new ports of this node.
If this method is used preconditions must be maintained on the model
and on the view. Therefore after invoking this method on the model
all associated views must be adjusted accordingly. In the case of
this instance being of the type Subgraph, ports of nested
nodes must be recursively adjusted on each nested level.
However clients are not required to use this method. There are other ways of adjusting/changing ports. Refer to the Graph manual for further information.
ports - the list of ports to use with this nodepublic void addNodeListener(NodeListener listener)
NodeListener to this
Node.
listener - the NodeListener
to add to this Node.public void removeNodeListener(NodeListener listener)
NodeListener from this
Node.
listener - the NodeListener
to remove from this Node.public Node deepCopy()
public void setID(long id)
id - the new id for this Nodepublic void internalResetPortNumbers()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||