Package com.github.moaxcp.graphs
Class ObservablePropertyGraph<ID>
java.lang.Object
com.github.moaxcp.graphs.AbstractPropertyGraph<ID>
com.github.moaxcp.graphs.ObservablePropertyGraph<ID>
- All Implemented Interfaces:
PropertyGraph<ID>
- Direct Known Subclasses:
ObservableDirectedPropertyGraph
,ObservableUndirectedPropertyGraph
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
Nested classes/interfaces inherited from class com.github.moaxcp.graphs.AbstractPropertyGraph
AbstractPropertyGraph.SimpleEdge, AbstractPropertyGraph.SimpleVertex
Nested classes/interfaces inherited from interface com.github.moaxcp.graphs.PropertyGraph
PropertyGraph.Edge<ID>, PropertyGraph.Vertex<ID>
-
Constructor Summary
ConstructorsConstructorDescriptionObservablePropertyGraph
(@NonNull PropertyGraphObserver<ID>... observers) ObservablePropertyGraph
(ID id, PropertyGraphObserver<ID>... observers) -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertyGraph.Edge<ID>
final ObservablePropertyGraph<ID>
addObserver
(@NonNull PropertyGraphObserver<ID>... observers) protected PropertyGraph.Vertex<ID>
Ensures an edge exists between source and target vertices.edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3) edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4) edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5) edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6) edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7) edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8) edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9) edge
(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9, String name10, Object value10) edgeProperty
(String name, Object value) Sets edge property returning this graphedgeProperty
(Map<String, Object> properties) protected PropertyGraph.Edge<ID>
protected PropertyGraph.Vertex<ID>
Sets property on this graph returning this graphvoid
removeEdge
(ID source, ID target) Removes edge with given from and to.removeEdgeProperty
(String name) Removes edge property returning this graphremoveObserver
(PropertyGraphObserver<ID> observer) removeProperty
(String name) Removes property on this graph returning this graphvoid
removeVertex
(ID id) Removes vertex with given id.removeVertexProperty
(String name) Removes vertex property returning this graphvoid
Sets the id of this graph.Ensure a vertex exists with id and returns the vertex.vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3) vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4) vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5) vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6) vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7) vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8) vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9) vertex
(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9, String name10, Object value10) vertexProperty
(String name, Object value) Sets vertex property returning this graphvertexProperty
(Map<String, Object> properties) Methods inherited from class com.github.moaxcp.graphs.AbstractPropertyGraph
equals, findEdge, findEdge, findEdgeProperty, findProperty, findVertex, findVertexProperty, getEdge, getEdge, getEdge, getEdge, getEdge, getEdge, getEdge, getEdge, getEdge, getEdge, getEdge, getEdge, getEdgeIds, getEdgeProperties, getEdgeProperty, getEdges, getId, getProperties, getProperty, getVertex, getVertex, getVertex, getVertex, getVertex, getVertex, getVertex, getVertex, getVertex, getVertex, getVertex, getVertex, getVertexProperties, getVertexProperty, getVertices, hashCode, id, newEdgeKey, removeEdge, setEdgeProperty, setProperty, setVertexProperty
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.moaxcp.graphs.PropertyGraph
breadthFirstIterator, breadthFirstStream, connected, isDirected, isEmpty, postOrderIterator, postOrderStream, preOrderIterator, preOrderStream, reversePostOrderIterator, reversePostOrderStream
-
Constructor Details
-
ObservablePropertyGraph
public ObservablePropertyGraph() -
ObservablePropertyGraph
-
ObservablePropertyGraph
-
ObservablePropertyGraph
-
-
Method Details
-
vertex
Description copied from interface:PropertyGraph
Ensure a vertex exists with id and returns the vertex. If the vertex does not exist it is created.- Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
- Parameters:
id
- of vertex- Returns:
- created or existing vertex
-
vertex
- Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
public ObservablePropertyGraph<ID> vertex(ID id, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9, String name10, Object value10) - Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
vertex
- Specified by:
vertex
in interfacePropertyGraph<ID>
- Overrides:
vertex
in classAbstractPropertyGraph<ID>
-
edge
Description copied from interface:PropertyGraph
Ensures an edge exists between source and target vertices. If an edge does not exist it is created. If any of the vertices do not exist they are created.If this graph is undirected and contains an edge connecting source and target the edge will not be created. Undirected graphs ignore source/target order in edges.
- Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
- Parameters:
source
- of edgetarget
- of edge- Returns:
- created or existing edge
-
edge
- Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
public ObservablePropertyGraph<ID> edge(ID source, ID target, String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6, String name7, Object value7, String name8, Object value8, String name9, Object value9, String name10, Object value10) - Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
edge
- Specified by:
edge
in interfacePropertyGraph<ID>
- Overrides:
edge
in classAbstractPropertyGraph<ID>
-
property
Description copied from interface:PropertyGraph
Sets property on this graph returning this graph- Specified by:
property
in interfacePropertyGraph<ID>
- Overrides:
property
in classAbstractPropertyGraph<ID>
- Parameters:
name
- of propertyvalue
- of property- Returns:
- this graph
-
removeProperty
Description copied from interface:PropertyGraph
Removes property on this graph returning this graph- Specified by:
removeProperty
in interfacePropertyGraph<ID>
- Overrides:
removeProperty
in classAbstractPropertyGraph<ID>
- Parameters:
name
- of property- Returns:
- this graph
-
edgeProperty
Description copied from interface:PropertyGraph
Sets edge property returning this graph- Specified by:
edgeProperty
in interfacePropertyGraph<ID>
- Overrides:
edgeProperty
in classAbstractPropertyGraph<ID>
- Parameters:
name
- of edge propertyvalue
- of edge property- Returns:
- this graph
-
removeEdgeProperty
Description copied from interface:PropertyGraph
Removes edge property returning this graph- Specified by:
removeEdgeProperty
in interfacePropertyGraph<ID>
- Overrides:
removeEdgeProperty
in classAbstractPropertyGraph<ID>
- Parameters:
name
- of property- Returns:
- this graph
-
vertexProperty
Description copied from interface:PropertyGraph
Sets vertex property returning this graph- Specified by:
vertexProperty
in interfacePropertyGraph<ID>
- Overrides:
vertexProperty
in classAbstractPropertyGraph<ID>
- Parameters:
name
- of propertyvalue
- of property- Returns:
- created or existing edge
-
removeVertexProperty
Description copied from interface:PropertyGraph
Removes vertex property returning this graph- Specified by:
removeVertexProperty
in interfacePropertyGraph<ID>
- Overrides:
removeVertexProperty
in classAbstractPropertyGraph<ID>
- Parameters:
name
- of property- Returns:
- this graph
-
getObservers
-
addObserver
@SafeVarargs public final ObservablePropertyGraph<ID> addObserver(@NonNull @NonNull PropertyGraphObserver<ID>... observers) -
removeObserver
-
setId
Description copied from interface:PropertyGraph
Sets the id of this graph.- Specified by:
setId
in interfacePropertyGraph<ID>
- Overrides:
setId
in classAbstractPropertyGraph<ID>
- Parameters:
id
- of graph
-
property
- Specified by:
property
in interfacePropertyGraph<ID>
- Overrides:
property
in classAbstractPropertyGraph<ID>
-
edgeProperty
- Specified by:
edgeProperty
in interfacePropertyGraph<ID>
- Overrides:
edgeProperty
in classAbstractPropertyGraph<ID>
-
vertexProperty
- Specified by:
vertexProperty
in interfacePropertyGraph<ID>
- Overrides:
vertexProperty
in classAbstractPropertyGraph<ID>
-
newVertex
protected PropertyGraph.Vertex<ID> newVertex(ID id, Map<String, Object> local, Map<String, Object> inherited) - Overrides:
newVertex
in classAbstractPropertyGraph<ID>
-
newEdge
protected PropertyGraph.Edge<ID> newEdge(ID from, ID to, Map<String, Object> local, Map<String, Object> inherited) - Overrides:
newEdge
in classAbstractPropertyGraph<ID>
-
addEdge
- Overrides:
addEdge
in classAbstractPropertyGraph<ID>
-
removeEdge
Description copied from interface:PropertyGraph
Removes edge with given from and to.- Specified by:
removeEdge
in interfacePropertyGraph<ID>
- Overrides:
removeEdge
in classAbstractPropertyGraph<ID>
- Parameters:
source
- of edgetarget
- of edge
-
addVertex
- Overrides:
addVertex
in classAbstractPropertyGraph<ID>
-
removeVertex
Description copied from interface:PropertyGraph
Removes vertex with given id. If edges connect to the vertex they are removed first.- Specified by:
removeVertex
in interfacePropertyGraph<ID>
- Overrides:
removeVertex
in classAbstractPropertyGraph<ID>
- Parameters:
id
- of vertex
-