Package com.github.moaxcp.graphs
Class AbstractPropertyGraph.SimpleEdge
java.lang.Object
com.github.moaxcp.graphs.AbstractPropertyGraph.SimpleEdge
- All Implemented Interfaces:
PropertyGraph.Edge<ID>
- Enclosing class:
- AbstractPropertyGraph<ID>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns ordered pair of endpoint ids.final boolean
<T> Optional<T>
findProperty
(String name) ReturnsOptional
of a property.getId()
Returns optional identifier of this edge.<T> T
getProperty
(String name) Returns a property.final ID
Returns vertex id of source endpoint.final ID
Returns vertex id of target endpoint.final int
hashCode()
final PropertyGraph.Edge<ID>
Sets identifier of this edge.Returns an unmodifiable map of inherited propertiesfinal boolean
Returns true if this edge is directed.local()
Returns an unmodifiable map of local propertiesSets the value of a local property returning this edge.Sets the value of 2 local properties returning this edge.property
(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4) property
(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5) property
(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5, String name6, Object value6) property
(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) property
(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) property
(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) property
(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) remove()
Removes this edge from the graph.removeProperty
(String name) Removes property from local properties returning this edge.void
Sets identifier of this edge.void
setProperty
(String name, Object value) Sets the value of a local property.void
Sets vertex id of source endpoint.void
Sets vertex id of source endpoint.final ID
source()
Returns vertex id of source endpoint.Sets vertex id of source endpoint.final PropertyGraph.Vertex<ID>
Returns source vertexfinal ID
target()
Returns vertex id of target endpoint.final PropertyGraph.Edge<ID>
Sets vertex id of target endpoint.final PropertyGraph.Vertex<ID>
Returns target vertextoString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.moaxcp.graphs.PropertyGraph.Edge
getOppositeEndpoint
-
Constructor Details
-
SimpleEdge
-
-
Method Details
-
inherited
Description copied from interface:PropertyGraph.Edge
Returns an unmodifiable map of inherited properties- Specified by:
inherited
in interfacePropertyGraph.Edge<ID>
- Returns:
- map of inherited properties
-
local
Description copied from interface:PropertyGraph.Edge
Returns an unmodifiable map of local properties- Specified by:
local
in interfacePropertyGraph.Edge<ID>
- Returns:
- map of local properties
-
getId
Description copied from interface:PropertyGraph.Edge
Returns optional identifier of this edge.- Specified by:
getId
in interfacePropertyGraph.Edge<ID>
- Returns:
- optional identifier
-
setId
Description copied from interface:PropertyGraph.Edge
Sets identifier of this edge.- Specified by:
setId
in interfacePropertyGraph.Edge<ID>
- Parameters:
id
- of edge
-
id
Description copied from interface:PropertyGraph.Edge
Sets identifier of this edge.- Specified by:
id
in interfacePropertyGraph.Edge<ID>
- Parameters:
id
- of edge- Returns:
- this edge
-
getSource
Description copied from interface:PropertyGraph.Edge
Returns vertex id of source endpoint.- Specified by:
getSource
in interfacePropertyGraph.Edge<ID>
- Returns:
- id of source endpoint
-
setSource
Description copied from interface:PropertyGraph.Edge
Sets vertex id of source endpoint. If vertex does not exist it is created.- Specified by:
setSource
in interfacePropertyGraph.Edge<ID>
- Parameters:
source
- endpoint
-
source
Description copied from interface:PropertyGraph.Edge
Sets vertex id of source endpoint. If vertex does not exist it is created.- Specified by:
source
in interfacePropertyGraph.Edge<ID>
- Parameters:
source
- endpoint- Returns:
- this edge
-
source
Description copied from interface:PropertyGraph.Edge
Returns vertex id of source endpoint.- Specified by:
source
in interfacePropertyGraph.Edge<ID>
- Returns:
- id of source endpoint
-
getTarget
Description copied from interface:PropertyGraph.Edge
Returns vertex id of target endpoint.- Specified by:
getTarget
in interfacePropertyGraph.Edge<ID>
- Returns:
- id of target endpoint
-
setTarget
Description copied from interface:PropertyGraph.Edge
Sets vertex id of source endpoint. If vertex does not exist it is created.- Specified by:
setTarget
in interfacePropertyGraph.Edge<ID>
- Parameters:
target
- endpoint
-
target
Description copied from interface:PropertyGraph.Edge
Sets vertex id of target endpoint. If vertex does not exist it is created.- Specified by:
target
in interfacePropertyGraph.Edge<ID>
- Parameters:
target
- endpoint- Returns:
- this edge
-
target
Description copied from interface:PropertyGraph.Edge
Returns vertex id of target endpoint.- Specified by:
target
in interfacePropertyGraph.Edge<ID>
- Returns:
- id of target endpoint
-
isDirected
public final boolean isDirected()Description copied from interface:PropertyGraph.Edge
Returns true if this edge is directed. This edge is always directed if the parent graph is directed.- Specified by:
isDirected
in interfacePropertyGraph.Edge<ID>
- Returns:
- true if this edge is directed
-
endpoints
Description copied from interface:PropertyGraph.Edge
Returns ordered pair of endpoint ids. source endpoint id is always first followed by target endpoint id.- Specified by:
endpoints
in interfacePropertyGraph.Edge<ID>
- Returns:
- order pair of endpoints
-
sourceVertex
Description copied from interface:PropertyGraph.Edge
Returns source vertex- Specified by:
sourceVertex
in interfacePropertyGraph.Edge<ID>
- Returns:
- source vertex
-
targetVertex
Description copied from interface:PropertyGraph.Edge
Returns target vertex- Specified by:
targetVertex
in interfacePropertyGraph.Edge<ID>
- Returns:
- target vertex
-
findProperty
Description copied from interface:PropertyGraph.Edge
ReturnsOptional
of a property. If the property does not exist the returnedOptional
is empty.A property is resolved by first checking properties set on this edge. If the local property does not exist edgeProperties in the graph are checked.
- Specified by:
findProperty
in interfacePropertyGraph.Edge<ID>
- Parameters:
name
- of property- Returns:
- optional of named property
-
getProperty
Description copied from interface:PropertyGraph.Edge
Returns a property. If the property does not exist null is returned.A property is resolved by first checking properties set on this edge. If the local proeprty does not exist edgeProperties in the graph are checked.
- Specified by:
getProperty
in interfacePropertyGraph.Edge<ID>
- Type Parameters:
T
- return type of property- Parameters:
name
- of property- Returns:
- value of named property
-
setProperty
Description copied from interface:PropertyGraph.Edge
Sets the value of a local property.- Specified by:
setProperty
in interfacePropertyGraph.Edge<ID>
- Parameters:
name
- of propertyvalue
- of property
-
property
Description copied from interface:PropertyGraph.Edge
Sets the value of a local property returning this edge.- Specified by:
property
in interfacePropertyGraph.Edge<ID>
- Parameters:
name
- of propertyvalue
- of property- Returns:
- this edge
-
property
Description copied from interface:PropertyGraph.Edge
Sets the value of 2 local properties returning this edge. Properties are added in order.- Specified by:
property
in interfacePropertyGraph.Edge<ID>
- Parameters:
name1
- of first propertyvalue1
- of first propertyname2
- of second propertyvalue2
- of second property- Returns:
- this edge
-
property
public PropertyGraph.Edge<ID> property(String name1, Object value1, String name2, Object value2, String name3, Object value3) - Specified by:
property
in interfacePropertyGraph.Edge<ID>
-
property
public PropertyGraph.Edge<ID> property(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4) - Specified by:
property
in interfacePropertyGraph.Edge<ID>
-
property
public PropertyGraph.Edge<ID> property(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5) - Specified by:
property
in interfacePropertyGraph.Edge<ID>
-
property
public PropertyGraph.Edge<ID> property(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:
property
in interfacePropertyGraph.Edge<ID>
-
property
public PropertyGraph.Edge<ID> property(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:
property
in interfacePropertyGraph.Edge<ID>
-
property
public PropertyGraph.Edge<ID> property(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:
property
in interfacePropertyGraph.Edge<ID>
-
property
public PropertyGraph.Edge<ID> property(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:
property
in interfacePropertyGraph.Edge<ID>
-
property
public PropertyGraph.Edge<ID> property(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:
property
in interfacePropertyGraph.Edge<ID>
-
property
- Specified by:
property
in interfacePropertyGraph.Edge<ID>
-
removeProperty
Description copied from interface:PropertyGraph.Edge
Removes property from local properties returning this edge.- Specified by:
removeProperty
in interfacePropertyGraph.Edge<ID>
- Parameters:
name
- of property- Returns:
- this edge
-
remove
Description copied from interface:PropertyGraph.Edge
Removes this edge from the graph.- Specified by:
remove
in interfacePropertyGraph.Edge<ID>
- Returns:
- this edge
-
equals
-
hashCode
public final int hashCode() -
toString
-