|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--drasys.or.graph.Graph | +--drasys.or.graph.BaseGraph | +--drasys.or.graph.DenseGraph
A implementation of a graph that is optimized for dense edges.
This graph supports parallel edges and a mixture of directed and undirected edges.
The vertex and edge method 'doubleValue()' returns a double value based on the element's value object.
If the value object is not null and either implements 'DoubleI' or is a subclass of 'Number'
then the returned value is 'value.doubleValue()'.
Otherwise; the value is zero.
References:
Graphs : Theory and Algorithms
K. Thulasiraman, M.N.S. Swamy / Paperback / Published 1992
Fields inherited from class drasys.or.graph.Graph |
_symmetric |
Constructor Summary | |
DenseGraph()
|
|
DenseGraph(int vertexCapacity)
|
Method Summary | |
EdgeI |
addEdge(EdgeI edge)
Adds a new edge to the graph. |
EdgeI |
addEdge(java.lang.Object fromKey,
java.lang.Object toKey)
Adds a new edge to the graph where: value=null, isDirected=false, key=null. |
EdgeI |
addEdge(java.lang.Object fromKey,
java.lang.Object toKey,
java.lang.Object value)
Adds a new edge to the graph where: isDirected=false, key=null. |
EdgeI |
addEdge(java.lang.Object fromKey,
java.lang.Object toKey,
java.lang.Object value,
boolean isDirected)
Adds a new edge to the graph where: key=null. |
EdgeI |
addEdge(java.lang.Object fromKey,
java.lang.Object toKey,
java.lang.Object value,
boolean isDirected,
java.lang.Object key)
Adds a new edge to the graph. |
void |
ensureEdgeCapacity(int edgeCapacity)
Increases the capacity of the graph if needed to ensure it can efficiently hold this many edges. |
EdgeI |
getEdge(VertexI from,
VertexI to,
java.lang.Object edgeKey)
Get the edge between the from and to vertices whose key matches 'edgeKey'. |
EdgeI |
getMutableEdge(VertexI from,
VertexI to,
java.lang.Object edgeKey)
Get the edge between the from and to vertices whose key matches 'edgeKey'. |
boolean |
isSymmetric()
Returns false by default. |
protected VertexI |
newVertex(java.lang.Object key,
java.lang.Object value)
|
java.lang.String |
toString()
|
Methods inherited from class drasys.or.graph.BaseGraph |
addVertex,
addVertex,
addVertex,
ensureVertexCapacity,
getChangeCount,
getVertex,
removeAllVertices,
sizeOfDirectedEdges,
sizeOfEdges,
sizeOfVertices,
vertices |
Methods inherited from class drasys.or.graph.Graph |
edges,
equals,
getEdge,
getEdge,
isSubsetOf,
mutableEdges,
setSymmetric,
toString |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public DenseGraph()
public DenseGraph(int vertexCapacity)
Method Detail |
public boolean isSymmetric()
public void ensureEdgeCapacity(int edgeCapacity)
public EdgeI addEdge(java.lang.Object fromKey, java.lang.Object toKey) throws DuplicateEdgeException, VertexNotFoundException
public EdgeI addEdge(java.lang.Object fromKey, java.lang.Object toKey, java.lang.Object value) throws DuplicateEdgeException, VertexNotFoundException
public EdgeI addEdge(java.lang.Object fromKey, java.lang.Object toKey, java.lang.Object value, boolean isDirected) throws DuplicateEdgeException, VertexNotFoundException
public EdgeI addEdge(EdgeI edge) throws DuplicateEdgeException, VertexNotFoundException
public final EdgeI addEdge(java.lang.Object fromKey, java.lang.Object toKey, java.lang.Object value, boolean isDirected, java.lang.Object key) throws DuplicateEdgeException, VertexNotFoundException
protected VertexI newVertex(java.lang.Object key, java.lang.Object value)
public EdgeI getMutableEdge(VertexI from, VertexI to, java.lang.Object edgeKey)
public EdgeI getEdge(VertexI from, VertexI to, java.lang.Object edgeKey)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |