helix.graph.model.impl
Class AbstractGraph

java.lang.Object
  extended by helix.graph.model.impl.AbstractRegistry
      extended by helix.graph.model.impl.DelegateRegistry
          extended by helix.graph.model.impl.AbstractGraph
All Implemented Interfaces:
Graph, Registry
Direct Known Subclasses:
MemGraph

public abstract class AbstractGraph
extends DelegateRegistry
implements Graph


Field Summary
 
Fields inherited from interface helix.graph.model.Registry
Color, Colors, Comment, IsDirect, Label, Orientation, Rank
 
Constructor Summary
AbstractGraph()
           
 
Method Summary
 void addPhysicalVertex(Vertex v)
          TODO a documenter serieusement
 Edge assertEdge(Vertex v1, Vertex v2)
           
 void clear()
           
 void disconnectVertex(Vertex v)
           
 Vertex findVertex(String registryKey, Object anyValue)
           
 Vertex findVertex(String registryKey, RegistryValue registryValue)
           
 GSet<Vertex> findVertices(String registryKey, Object anyValue)
           
 GSet<Vertex> findVertices(String registryKey, RegistryValue registryValue)
           
 Edge getEdge(Vertex v1, Vertex v2)
           
 boolean hasEdge(Vertex v1, Vertex v2)
           
 boolean hasVertex(Vertex v)
           
 int nbEdges()
          this implementation is O(n).
 int nbVertices()
           
 Set<Graph> physicalSplit(Iterable<GSet<Vertex>> splits)
          TODO a documenter serieusement en particulier : destroy the current graph accepte un visiteur a classes recouvrantes et non totalement couvrant
 void removeEdge(Edge e)
           
 void removeVertex(Vertex v)
           
 Iterable<Vertex> vertices()
           
 
Methods inherited from class helix.graph.model.impl.DelegateRegistry
get, has, keys, registry, remove, set
 
Methods inherited from class helix.graph.model.impl.AbstractRegistry
copy, set, set, set, set, set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface helix.graph.model.Graph
addEdge, addVertex, edgeSetFactory, factory, removeEdge, vertexSetFactory
 
Methods inherited from interface helix.graph.model.Registry
copy, get, has, keys, registry, remove, set, set, set, set, set, set
 

Constructor Detail

AbstractGraph

public AbstractGraph()
Method Detail

nbVertices

public int nbVertices()
Specified by:
nbVertices in interface Graph

nbEdges

public int nbEdges()
this implementation is O(n). you may override it if you can provide a better way to do this

Specified by:
nbEdges in interface Graph

vertices

public Iterable<Vertex> vertices()
Specified by:
vertices in interface Graph

hasVertex

public boolean hasVertex(Vertex v)
Specified by:
hasVertex in interface Graph

disconnectVertex

public void disconnectVertex(Vertex v)
                      throws NoSuchVertexException
Specified by:
disconnectVertex in interface Graph
Throws:
NoSuchVertexException

removeVertex

public void removeVertex(Vertex v)
                  throws NoSuchVertexException
Specified by:
removeVertex in interface Graph
Throws:
NoSuchVertexException

getEdge

public Edge getEdge(Vertex v1,
                    Vertex v2)
             throws NoSuchVertexException
Specified by:
getEdge in interface Graph
Throws:
NoSuchVertexException

hasEdge

public boolean hasEdge(Vertex v1,
                       Vertex v2)
Specified by:
hasEdge in interface Graph

assertEdge

public Edge assertEdge(Vertex v1,
                       Vertex v2)
                throws NoSuchVertexException,
                       SameVertexException
Specified by:
assertEdge in interface Graph
Throws:
NoSuchVertexException
SameVertexException

removeEdge

public void removeEdge(Edge e)
Specified by:
removeEdge in interface Graph

findVertex

public Vertex findVertex(String registryKey,
                         RegistryValue registryValue)
                  throws DuplicateValueException
Specified by:
findVertex in interface Graph
Throws:
DuplicateValueException

findVertex

public Vertex findVertex(String registryKey,
                         Object anyValue)
                  throws DuplicateValueException
Specified by:
findVertex in interface Graph
Throws:
DuplicateValueException

findVertices

public GSet<Vertex> findVertices(String registryKey,
                                 RegistryValue registryValue)
Specified by:
findVertices in interface Graph

findVertices

public GSet<Vertex> findVertices(String registryKey,
                                 Object anyValue)
Specified by:
findVertices in interface Graph

clear

public void clear()
Specified by:
clear in interface Graph

addPhysicalVertex

public void addPhysicalVertex(Vertex v)
TODO a documenter serieusement

Specified by:
addPhysicalVertex in interface Graph

physicalSplit

public Set<Graph> physicalSplit(Iterable<GSet<Vertex>> splits)
TODO a documenter serieusement en particulier : destroy the current graph accepte un visiteur a classes recouvrantes et non totalement couvrant

Specified by:
physicalSplit in interface Graph