agl2
Class GraphBuilder
java.lang.Object
|
+--agl2.GraphBuilder
All Implemented Interfaces: Graph , GraphTag , MutableGraph
Direct Known Subclasses: BigraphBuilder , DigraphBuilder , UngraphBuilder
public abstract class GraphBuilder extends java.lang.Objectimplements MutableGraph , GraphTag
The GraphBuilder
builds a representation of
a graph.
Fields inherited from interface agl2.GraphTag
allTags , BIGRAPH , DIGRAPH , EDGE_DATA , EDGE_INDEX , EDGE_WEIGHT , GRAPH_ACYLIC , GRAPH_NAME , GRAPH_ROOT , GRAPH_TRAITS , MULTIGRAPH , OBJECT_VERTEX , UNGRAPH , VERTEX_COLOR , VERTEX_DATA , VERTEX_DISTANCE , VERTEX_EDGEMAP , VERTEX_INDEX
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
rep
protected EdgeRep rep
properties
protected GraphProperties properties
listeners
protected GraphEventMulticast listeners
vertexCount
protected int vertexCount
GraphBuilder
public GraphBuilder ()
Construct a graph Builder for the rep.
GraphBuilder
public GraphBuilder (GraphTag [] tags)
GraphBuilder
public GraphBuilder (EdgeRep r)
initializeTags
protected void initializeTags (GraphTag [] tags)
getGraph
public abstract Graph getGraph ()
getVertices
public java.util.Set getVertices ()
Specified by: getVertices
in interface Graph
Returns: Set v in V
getEdges
public java.util.Set getEdges ()
Specified by: getEdges
in interface Graph
Returns: Set e in E
addVertex
public java.lang.Object addVertex (java.lang.Object o)
Description copied from interface: MutableGraph
add a vertex label to the graph returning a vertex object.
This may or may not be the Object argument passed (this
depends on the type of Graph representation being used.
A map is provided to translate between label objects
and vertex objects.
Specified by: addVertex
in interface MutableGraph
Returns: a Vertex object or label object See Also: GrapTag
,
PropertyMap
remVertex
public void remVertex (java.lang.Object o)
Description copied from interface: MutableGraph
Remove a vertex (and all edges emanating or arriving) A
vertex or labelling object may be passed. If a labelling
objects is passes it will translated internally
Specified by: remVertex
in interface MutableGraph
Parameters: o
- The vertex
hasVertex
public boolean hasVertex (java.lang.Object o)
addEdge
public Edge addEdge (java.lang.Object v1,
java.lang.Object v2,
java.lang.Object et)
Description copied from interface: MutableGraph
Add an edge to the graph.
Specified by: addEdge
in interface MutableGraph
Parameters: v1
- a label or vertexv2
- a label or vertexet
- an edge label or object (placed EDGE_NAMES map)
Returns: an edge See Also: GraphTag
remEdge
public void remEdge (java.lang.Object v1,
java.lang.Object v2)
Description copied from interface: MutableGraph
Add an edge to the graph.
Specified by: remEdge
in interface MutableGraph
Parameters: v1
- a label or vertexv2
- a label or vertex
Returns: an edge See Also: GraphTag
remEdge
public void remEdge (Edge e)
Specified by: remEdge
in interface MutableGraph
hasEdge
public boolean hasEdge (java.lang.Object v1,
java.lang.Object v2)
setRoot
public void setRoot (java.lang.Object root)
addListener
public void addListener (GraphListener gl)
Specified by: addListener
in interface MutableGraph
remListener
public void remListener (GraphListener gl)
Specified by: remListener
in interface MutableGraph
toString
public java.lang.String toString ()
Overrides: toString
in class java.lang.Object