uchicago.src.sim.network
Interface Node

All Known Subinterfaces:
Drawable2DNode
All Known Implementing Classes:
DefaultNode, OvalNode, RectNode

public interface Node

A simple interface for a graph node in a networked space.

Version:
$Revision: 1.5 $
Author:
Nick Collier

Method Summary
 void addInEdge(Edge edge)
          Add an in edge to this node.
 void addOutEdge(Edge edge)
          Add an out edge to this node.
 void clearInEdges()
          Clears (removes) all the in edges.
 void clearOutEdges()
          Clears (removes) all the out edges.
 java.lang.Object getId()
          Gets the id associated with this node.
 java.util.ArrayList getInEdges()
          Gets the edges coming into this node.
 java.lang.String getNodeLabel()
          Gets the label of this node.
 java.util.ArrayList getOutEdges()
          Gets the edges going out from this node.
 boolean hasEdgeFrom(Node node)
          Returns true if this DefaultNode has an Edge from the specified Node, otherwise false.
 boolean hasEdgeTo(Node node)
          Returns true if this DefaultNode has an Edge to the specified Node, otherwise false.
 void removeInEdge(Edge edge)
          Removes the specified edge from the list of "in" edges.
 void removeOutEdge(Edge edge)
          Removes the specified edge from the list of "out" edges.
 void setNodeLabel(java.lang.String node)
           
 

Method Detail

getId

public java.lang.Object getId()
Gets the id associated with this node.


getNodeLabel

public java.lang.String getNodeLabel()
Gets the label of this node.


setNodeLabel

public void setNodeLabel(java.lang.String node)

getInEdges

public java.util.ArrayList getInEdges()
Gets the edges coming into this node.


getOutEdges

public java.util.ArrayList getOutEdges()
Gets the edges going out from this node.


addInEdge

public void addInEdge(Edge edge)
Add an in edge to this node.


addOutEdge

public void addOutEdge(Edge edge)
Add an out edge to this node.


removeInEdge

public void removeInEdge(Edge edge)
Removes the specified edge from the list of "in" edges.

Parameters:
edge - the edge to remove

removeOutEdge

public void removeOutEdge(Edge edge)
Removes the specified edge from the list of "out" edges.

Parameters:
edge - the edge to remove

clearInEdges

public void clearInEdges()
Clears (removes) all the in edges.


clearOutEdges

public void clearOutEdges()
Clears (removes) all the out edges.


hasEdgeTo

public boolean hasEdgeTo(Node node)
Returns true if this DefaultNode has an Edge to the specified Node, otherwise false.


hasEdgeFrom

public boolean hasEdgeFrom(Node node)
Returns true if this DefaultNode has an Edge from the specified Node, otherwise false.