N
- node typeE
- edge typepublic abstract class Graph<N extends Graph.IGraphNode<E>,E extends Graph.IGraphEdge<N>>
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
Graph.IGraphEdge<N>
Graph Edge interface
|
static interface |
Graph.IGraphNode<E>
Graph Node interface
|
Modifier and Type | Field and Description |
---|---|
protected java.util.HashSet<E> |
edges
Edges
|
protected java.util.List<N> |
nodes
Nodes
|
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
|
Graph()
Constructor
|
protected |
Graph(java.util.List<N> nodes,
java.util.HashSet<E> edges)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.HashSet<E> |
getEdges()
Get edges
|
N |
getNode(int i)
Get ith node
|
java.util.List<N> |
getNodes()
Get nodes
|
java.lang.String |
toLongString()
Get long string
|
java.lang.String |
toString() |
private static final long serialVersionUID
protected final java.util.List<N extends Graph.IGraphNode<E>> nodes
protected final java.util.HashSet<E extends Graph.IGraphEdge<N>> edges
public java.util.List<N> getNodes()
public java.util.HashSet<E> getEdges()
public N getNode(int i)
i
- node indexpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toLongString()