N - The type of Node stored in this GraphET - The type of Edge stored in this Graphpublic class SimpleListGraph<N,ET extends Edge<N>> extends java.lang.Object implements Graph<N,ET>
| Constructor and Description |
|---|
SimpleListGraph()
Create a new, empty SimpleListMapGraph.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEdge(ET e)
Adds the given Edge to the Graph.
|
void |
addGraphChangeListener(GraphChangeListener<N,ET> arg0)
Adds the given GraphChangeListener as a GraphChangeListener of this
Graph.
|
boolean |
addNode(N v)
Add the given Node to the Graph.
|
void |
clear()
Clears this Graph, removing all Nodes and Edges from the Graph.
|
boolean |
containsEdge(Edge<?> e)
Returns true if the Graph contains the given Object as an Edge.
|
boolean |
containsNode(java.lang.Object v)
Returns true if the Graph contains the given Object as a Node.
|
boolean |
equals(java.lang.Object other)
Tests to see if this Graph is equal to the provided Object.
|
java.util.Set<ET> |
getAdjacentEdges(N gn)
Returns a Set of the Edges which are Adjacent (connected) to the given
Node.
|
java.util.List<ET> |
getEdgeList()
Returns a List of the Edges contained in this Graph.
|
GraphChangeListener<N,ET>[] |
getGraphChangeListeners()
Returns an array of the GraphChangeListeners to this Graph.
|
int |
getNodeCount()
Returns the number of nodes in this Graph.
|
java.util.List<N> |
getNodeList()
Returns a List of the Nodes contained within this Graph.
|
int |
hashCode()
Returns the hashCode for this Graph.
|
boolean |
isEmpty()
Returns true if this Graph is empty (has no Nodes and no Edges); false
otherwise.
|
boolean |
removeEdge(ET ge)
Removes the given Edge from the Graph.
|
void |
removeGraphChangeListener(GraphChangeListener<N,ET> arg0)
Removes the given GraphChangeListener as a GraphChangeListener of this
Graph.
|
boolean |
removeNode(N gn)
Removes the given Node from the Graph.
|
public boolean addNode(N v)
public boolean addEdge(ET e)
public boolean containsNode(java.lang.Object v)
containsNode in interface Graph<N,ET extends Edge<N>>v - The Object to be tested to determine if it is a Node in the
Graph.Graph.containsNode(java.lang.Object)public boolean containsEdge(Edge<?> e)
containsEdge in interface Graph<N,ET extends Edge<N>>e - The Edge to be tested to determine if it is a Edge in the
Graph.Graph.containsEdge(pcgen.base.graph.base.Edge)public java.util.List<N> getNodeList()
getNodeList in interface Graph<N,ET extends Edge<N>>Graph.getNodeList()public java.util.List<ET> getEdgeList()
getEdgeList in interface Graph<N,ET extends Edge<N>>Graph.getEdgeList()public boolean removeNode(N gn)
removeNode in interface Graph<N,ET extends Edge<N>>gn - The Node to remove from the GraphGraph.removeNode(java.lang.Object)public boolean removeEdge(ET ge)
removeEdge in interface Graph<N,ET extends Edge<N>>ge - The Edge to remove from the GraphGraph.removeEdge(pcgen.base.graph.base.Edge)public java.util.Set<ET> getAdjacentEdges(N gn)
getAdjacentEdges in interface Graph<N,ET extends Edge<N>>gn - The Node for which the adjacent Edges should be returned.Graph.getAdjacentEdges(java.lang.Object)public void addGraphChangeListener(GraphChangeListener<N,ET> arg0)
addGraphChangeListener in interface Graph<N,ET extends Edge<N>>arg0 - The GraphChangeListener to receive GraphChangeEventsGraph.addGraphChangeListener(pcgen.base.graph.base.GraphChangeListener)public GraphChangeListener<N,ET>[] getGraphChangeListeners()
getGraphChangeListeners in interface Graph<N,ET extends Edge<N>>Graph.getGraphChangeListeners()public void removeGraphChangeListener(GraphChangeListener<N,ET> arg0)
removeGraphChangeListener in interface Graph<N,ET extends Edge<N>>arg0 - The GraphChangeListener to be removedGraph.removeGraphChangeListener(pcgen.base.graph.base.GraphChangeListener)public boolean equals(java.lang.Object other)
public int hashCode()
public boolean isEmpty()
public int getNodeCount()