public class EventGraph<T extends Graph> extends Object implements Graph, WrapperGraph<T>
GraphChangedListener to
the EventGraph by utilizing the addListener method. EventGraph allows the addition of multiple GraphChangedListener
implementations. Each listener will be notified in the order that it was added.| Modifier and Type | Field and Description |
|---|---|
protected T |
baseGraph |
protected List<GraphChangedListener> |
graphChangedListeners |
protected EventTrigger |
trigger |
| Constructor and Description |
|---|
EventGraph(T baseGraph) |
| Modifier and Type | Method and Description |
|---|---|
Edge |
addEdge(Object id,
Vertex outVertex,
Vertex inVertex,
String label)
Raises an edgeAdded event.
|
void |
addListener(GraphChangedListener listener) |
Vertex |
addVertex(Object id)
Raises a vertexAdded event.
|
T |
getBaseGraph()
Get the graph this wrapper delegates to.
|
Edge |
getEdge(Object id)
Return the edge referenced by the provided object identifier.
|
Iterable<Edge> |
getEdges()
Return an iterable to all the edges in the graph.
|
Iterable<Edge> |
getEdges(String key,
Object value)
Return an iterable to all the edges in the graph that have a particular key/value property.
|
Features |
getFeatures()
Get the particular features of the graph implementation.
|
Iterator<GraphChangedListener> |
getListenerIterator() |
EventTrigger |
getTrigger() |
Vertex |
getVertex(Object id)
Return the vertex referenced by the provided object identifier.
|
Iterable<Vertex> |
getVertices()
Return an iterable to all the vertices in the graph.
|
Iterable<Vertex> |
getVertices(String key,
Object value)
Return an iterable to all the vertices in the graph that have a particular key/value property.
|
protected void |
onEdgeAdded(Edge edge) |
protected void |
onEdgeRemoved(Edge edge,
Map<String,Object> props) |
protected void |
onVertexAdded(Vertex vertex) |
protected void |
onVertexRemoved(Vertex vertex,
Map<String,Object> props) |
GraphQuery |
query()
Generate a query object that can be used to fine tune which edges/vertices are retrieved from the graph.
|
void |
removeAllListeners() |
void |
removeEdge(Edge edge)
Raises an edgeRemoved event.
|
void |
removeListener(GraphChangedListener listener) |
void |
removeVertex(Vertex vertex)
Raises a vertexRemoved event.
|
void |
shutdown()
A shutdown function is required to properly close the graph.
|
String |
toString() |
protected EventTrigger trigger
protected final List<GraphChangedListener> graphChangedListeners
public EventGraph(T baseGraph)
public void removeAllListeners()
public void addListener(GraphChangedListener listener)
public Iterator<GraphChangedListener> getListenerIterator()
public EventTrigger getTrigger()
public void removeListener(GraphChangedListener listener)
protected void onVertexAdded(Vertex vertex)
protected void onEdgeAdded(Edge edge)
public Vertex getVertex(Object id)
Graphpublic void removeVertex(Vertex vertex)
removeVertex in interface Graphvertex - the vertex to remove from the graphpublic Iterable<Vertex> getVertices()
GraphgetVertices in interface Graphpublic Iterable<Vertex> getVertices(String key, Object value)
GraphgetVertices in interface Graphkey - the key of vertexvalue - the value of the vertexpublic Edge addEdge(Object id, Vertex outVertex, Vertex inVertex, String label)
public Edge getEdge(Object id)
Graphpublic void removeEdge(Edge edge)
removeEdge in interface Graphedge - the edge to remove from the graphpublic Iterable<Edge> getEdges()
Graphpublic Iterable<Edge> getEdges(String key, Object value)
Graphpublic GraphQuery query()
Graphpublic void shutdown()
Graphpublic T getBaseGraph()
WrapperGraphgetBaseGraph in interface WrapperGraph<T extends Graph>public Features getFeatures()
GraphgetFeatures in interface GraphCopyright © 2010-2014. All Rights Reserved.