jcommon.graph
Class ObjectGraph

java.lang.Object
  extended by jcommon.graph.DirectedAcyclicGraph<ObjectVertex>
      extended by jcommon.graph.ObjectGraph
All Implemented Interfaces:
Cloneable, IGraph<ObjectVertex>

public class ObjectGraph
extends DirectedAcyclicGraph<ObjectVertex>

Factory and implementation of a dependency graph that can topologically sort vertices that are Objects.

See Also:
DirectedAcyclicGraph

Field Summary
 
Fields inherited from interface jcommon.graph.IGraph
EMPTY_VERTICES
 
Method Summary
 ObjectGraph addEdge(ObjectVertex from, ObjectVertex to)
          Adds a new IEdge instance to this IGraph.
 ObjectGraph addVertex(Object vertex)
           
static ObjectGraph buildFromObjects(Object... vertices)
           
 ObjectGraph copyAsObjectGraph()
           
static ObjectGraph createForObjects()
           
 ObjectGraph removeEdge(ObjectVertex from, ObjectVertex to)
          Removes an existing edge from this IGraph.
 ObjectGraph removeVertex(Object vertex)
           
 
Methods inherited from class jcommon.graph.DirectedAcyclicGraph
addVertex, build, copy, create, getEdges, getVertices, removeVertex, sort, sort, sortAsync, sortAsync, sortAsync, sortAsync, sortAsync, sortAsync, sortAsync, sortAsync, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copyAsObjectGraph

public ObjectGraph copyAsObjectGraph()
See Also:
DirectedAcyclicGraph.copy()

buildFromObjects

public static ObjectGraph buildFromObjects(Object... vertices)
See Also:
DirectedAcyclicGraph.build(jcommon.graph.IVertex[])

createForObjects

public static ObjectGraph createForObjects()
See Also:
DirectedAcyclicGraph.create()

addVertex

public ObjectGraph addVertex(Object vertex)
See Also:
DirectedAcyclicGraph.addVertex(jcommon.graph.IVertex)

removeVertex

public ObjectGraph removeVertex(Object vertex)
See Also:
DirectedAcyclicGraph.removeVertex(jcommon.graph.IVertex)

addEdge

public ObjectGraph addEdge(ObjectVertex from,
                           ObjectVertex to)
Description copied from interface: IGraph
Adds a new IEdge instance to this IGraph.

Specified by:
addEdge in interface IGraph<ObjectVertex>
Overrides:
addEdge in class DirectedAcyclicGraph<ObjectVertex>
Parameters:
from - An instance of IVertex of TVertex that begins the edge.
to - An instance of IVertex of TVertex that the edge is pointing to.
Returns:
The current instance of IGraph for use in a builder-style pattern.
See Also:
DirectedAcyclicGraph.addEdge(jcommon.graph.IVertex, jcommon.graph.IVertex)

removeEdge

public ObjectGraph removeEdge(ObjectVertex from,
                              ObjectVertex to)
Description copied from interface: IGraph
Removes an existing edge from this IGraph.

Specified by:
removeEdge in interface IGraph<ObjectVertex>
Overrides:
removeEdge in class DirectedAcyclicGraph<ObjectVertex>
Parameters:
from - An instance of IVertex of TVertex that begins the edge.
to - An instance of IVertex of TVertex that the edge is pointing to.
Returns:
The current instance of IGraph for use in a builder-style pattern.
See Also:
DirectedAcyclicGraph.removeEdge(jcommon.graph.IVertex, jcommon.graph.IVertex)


Copyright © 2012-2013. All Rights Reserved.