|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uconn.mcb.lineageevolver.graph.EdgeListGraph
Comment for this type goes here.
Field Summary | |
private java.util.ArrayList |
_edges
Our list of edges. |
private java.util.ArrayList |
_nodes
Our list of nodes. |
Constructor Summary | |
EdgeListGraph()
Default constructor for objects of type EdgeListGraph. |
Method Summary | |
GraphEdge |
addEdge(java.lang.Object data,
GraphNode origin,
GraphNode destination)
Adds an edge to this graph. |
GraphNode |
addNode(java.lang.Object data)
Adds a node to this graph. |
GraphNode[] |
getAdjacentNodes(GraphNode v)
Retrieves all nodes directly adjacent to the given node. |
java.lang.Object |
getData(GraphEdge e)
Returns the data stored inside a given edge. |
java.lang.Object |
getData(GraphNode v)
Returns the data stored inside a given node. |
GraphEdge[] |
getEdges(GraphNode v)
Retrieves all edges outgoing from a given node. |
GraphNode[] |
getNodes()
Retrieves all nodes in this graph. |
GraphNode[] |
getNodes(GraphEdge e)
Retrieves the two nodes connected by a given edge. |
void |
setData(GraphEdge e,
java.lang.Object data)
Sets the data for a given edge. |
void |
setData(GraphNode v,
java.lang.Object data)
Sets the data for a given node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.ArrayList _edges
private java.util.ArrayList _nodes
Constructor Detail |
public EdgeListGraph()
Method Detail |
public GraphEdge[] getEdges(GraphNode v)
DirectedGraph
getEdges
in interface DirectedGraph
v
- the node for which to retrieve the edges.
DirectedGraph.getEdges(edu.uconn.mcb.lineageevolver.graph.GraphNode)
public GraphNode[] getNodes(GraphEdge e)
DirectedGraph
getNodes
in interface DirectedGraph
e
- the edge for which to retrieve the nodes.
DirectedGraph.getNodes(edu.uconn.mcb.lineageevolver.graph.GraphEdge)
public GraphNode addNode(java.lang.Object data)
DirectedGraph
addNode
in interface DirectedGraph
data
- the data to store in the new node.
DirectedGraph.addNode(java.lang.Object)
public GraphEdge addEdge(java.lang.Object data, GraphNode origin, GraphNode destination)
DirectedGraph
addEdge
in interface DirectedGraph
data
- the data to store in the new edge.origin
- the origin node of this edge.destination
- the destination node of this edge.
DirectedGraph.addEdge(java.lang.Object, edu.uconn.mcb.lineageevolver.graph.GraphNode, edu.uconn.mcb.lineageevolver.graph.GraphNode)
public GraphNode[] getNodes()
DirectedGraph
getNodes
in interface DirectedGraph
Returns a deep copy of our local array of nodes, but a shallow copy of the nodes themselves.
public java.lang.Object getData(GraphNode v)
DirectedGraph
getData
in interface DirectedGraph
v
- the node from which to retrieve data.
DirectedGraph.getData(edu.uconn.mcb.lineageevolver.graph.GraphNode)
public java.lang.Object getData(GraphEdge e)
DirectedGraph
getData
in interface DirectedGraph
e
- the edge from which to retrieve data.
DirectedGraph.getData(edu.uconn.mcb.lineageevolver.graph.GraphEdge)
public void setData(GraphNode v, java.lang.Object data)
DirectedGraph
setData
in interface DirectedGraph
v
- the node for which to set the data.data
- the data to store inside the given node.DirectedGraph.setData(edu.uconn.mcb.lineageevolver.graph.GraphNode, java.lang.Object)
public void setData(GraphEdge e, java.lang.Object data)
DirectedGraph
setData
in interface DirectedGraph
e
- the edge for which to set the data.data
- the data to store inside the given edge.DirectedGraph.setData(edu.uconn.mcb.lineageevolver.graph.GraphEdge, java.lang.Object)
public GraphNode[] getAdjacentNodes(GraphNode v)
DirectedGraph
getAdjacentNodes
in interface DirectedGraph
v
- the node for which to retrieve adjacent nodes.
This method does not ensure that there are no duplicate nodes in the returned array.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |