N - The class representing the nodes of the graphE - The class representing the edges of the graphpublic abstract class AbstractGraph<N,E> extends java.lang.Object implements Graph<N,E>, java.io.Serializable
Graph.Segment<N,E>| Constructor and Description |
|---|
AbstractGraph() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(Graph<? extends N,? extends E> graph)
Add all elements from the specified graph to this graph.
|
void |
clear()
Clear all nodes and edges from this graph
|
boolean |
contains(java.lang.Object obj)
Determines whether the given object is a node within this graph.
|
boolean |
containsEdge(java.lang.Object obj)
Determines whether the given object is an edge within this graph.
|
java.util.Iterator<E> |
edgeIterator()
Return an iterator over the set of edges for this graph.
|
boolean |
equals(java.lang.Object obj)
Determine whether another object is the same as this graph.
|
java.util.Set<E> |
getNodeEdges(N node)
Get the set of edges which connect to a particular node.
|
int |
hashCode()
Get the hash code for this graph
|
abstract boolean |
isDirected()
Return whether this graph is a directed graph
|
boolean |
isEmpty()
Return whether the graph is empty.
|
java.util.Iterator<N> |
iterator()
Return an iterator over the set of nodes for this graph.
|
int |
order()
Return the order of the graph.
|
boolean |
remove(java.lang.Object obj)
Remove an object from the graph.
|
boolean |
removeEdge(java.lang.Object edge)
Remove the edge from the graph
|
int |
size()
Return the size of the graph.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitadd, addEdge, getEdge, getEdgeSegment, getEdgeSet, getNodeSet, getSegmentSetpublic void addAll(Graph<? extends N,? extends E> graph)
public void clear()
public boolean contains(java.lang.Object obj)
public boolean containsEdge(java.lang.Object obj)
containsEdge in interface Graph<N,E>obj - the object to testpublic java.util.Iterator<E> edgeIterator()
edgeIterator in interface Graph<N,E>public boolean equals(java.lang.Object obj)
public java.util.Set<E> getNodeEdges(N node)
getNodeEdges in interface Graph<N,E>node - the node to checkpublic int hashCode()
public abstract boolean isDirected()
isDirected in interface Graph<N,E>public boolean isEmpty()
public java.util.Iterator<N> iterator()
public int order()
public boolean remove(java.lang.Object obj)
public boolean removeEdge(java.lang.Object edge)
removeEdge in interface Graph<N,E>edge - the edge to remove