-
- Type Parameters:
ID
- type of identifier
- All Known Implementing Classes:
AbstractGraph.SimpleEdge
public static interface Graph.Edge<ID>
An edge between two vertices in a graph. Edge direction depends on graph type. If the graph is directedisDirected()
will return true.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<ID>
endpoints()
Returns ordered pair of endpoint ids.ID
from()
Returns vertex id of 'from' endpoint.Graph.Edge<ID>
from(ID from)
Sets vertex id of 'from' endpoint.Graph.Vertex<ID>
fromVertex()
Returns 'from' vertexID
getFrom()
Returns vertex id of 'from' endpoint.Optional<ID>
getId()
Returns optional identifier of this edge.Optional<Object>
getProperty(String name)
ReturnsOptional
of a property.ID
getTo()
Returns vertex id of 'to' endpoint.Graph.Edge<ID>
id(ID id)
Sets identifier of this edge.Map<String,Object>
inherited()
Returns an unmodifiable map of inherited propertiesboolean
isDirected()
Returns true if this edge is directed.Map<String,Object>
local()
Returns an unmodifiable map of local propertiesGraph.Edge<ID>
property(String name, Object value)
Sets the value of a local property returning this edge.Graph.Edge<ID>
property(String name1, Object value1, String name2, Object value2)
Sets the value of 2 local properties returning this edge.Graph.Edge<ID>
property(String name1, Object value1, String name2, Object value2, String name3, Object value3)
Graph.Edge<ID>
property(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4)
Graph.Edge<ID>
property(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5)
Graph.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)
Graph.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)
Graph.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)
Graph.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)
Graph.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)
Graph.Edge<ID>
property(Map<String,Object> properties)
Graph.Edge<ID>
removeProperty(String name)
Removes property from local properties returning this edge.void
setFrom(ID from)
Sets vertex id of 'from' endpoint.void
setId(ID id)
Sets identifier of this edge.void
setProperty(String name, Object value)
Sets the value of a local property.void
setTo(ID to)
Sets vertex id of 'to' endpoint.ID
to()
Returns vertex id of 'to' endpoint.Graph.Edge<ID>
to(ID to)
Sets vertex id of 'to' endpoint.Graph.Vertex<ID>
toVertex()
Returns 'to' vertex
-
-
-
Method Detail
-
setId
void setId(ID id)
Sets identifier of this edge.- Parameters:
id
- of edge- Throws:
NullPointerException
- if id is null
-
id
Graph.Edge<ID> id(ID id)
Sets identifier of this edge.- Parameters:
id
- of edge- Returns:
- this edge
- Throws:
NullPointerException
- if id is null
-
getFrom
ID getFrom()
Returns vertex id of 'from' endpoint.- Returns:
- id of 'from' endpoint
-
setFrom
void setFrom(ID from)
Sets vertex id of 'from' endpoint. If vertex does not exist it is created.- Parameters:
from
- endpoint- Throws:
NullPointerException
- if from is null
-
from
ID from()
Returns vertex id of 'from' endpoint.- Returns:
- id of 'from' endpoint
-
from
Graph.Edge<ID> from(ID from)
Sets vertex id of 'from' endpoint. If vertex does not exist it is created.- Parameters:
from
- endpoint- Returns:
- this edge
- Throws:
NullPointerException
- if from is null
-
getTo
ID getTo()
Returns vertex id of 'to' endpoint.- Returns:
- id of 'to' endpoint
-
setTo
void setTo(ID to)
Sets vertex id of 'to' endpoint. If vertex does not exist it is created.- Parameters:
to
- endpoint- Throws:
NullPointerException
- if to is null
-
to
ID to()
Returns vertex id of 'to' endpoint.- Returns:
- id of 'to' endpoint
-
to
Graph.Edge<ID> to(ID to)
Sets vertex id of 'to' endpoint. If vertex does not exist it is created.- Parameters:
to
- endpoint- Returns:
- this edge
-
endpoints
List<ID> endpoints()
Returns ordered pair of endpoint ids. 'from' endpoint id is always first followed by 'to' endpoint id.- Returns:
- order pair of endpoints
-
fromVertex
Graph.Vertex<ID> fromVertex()
Returns 'from' vertex- Returns:
- 'from' vertex
-
toVertex
Graph.Vertex<ID> toVertex()
Returns 'to' vertex- Returns:
- 'to' vertex
-
isDirected
boolean isDirected()
Returns true if this edge is directed. This edge is always directed if the parent graph is directed.- Returns:
- true if this edge is directed
-
getProperty
Optional<Object> getProperty(String name)
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.
- Parameters:
name
- of property- Returns:
- optional of named property
- Throws:
NullPointerException
- if name is null
-
setProperty
void setProperty(String name, Object value)
Sets the value of a local property.- Parameters:
name
- of propertyvalue
- of property- Throws:
NullPointerException
- if name or value is null
-
property
Graph.Edge<ID> property(String name, Object value)
Sets the value of a local property returning this edge.- Parameters:
name
- of propertyvalue
- of property- Returns:
- this edge
- Throws:
NullPointerException
- if name or value is null
-
property
Graph.Edge<ID> property(String name1, Object value1, String name2, Object value2)
Sets the value of 2 local properties returning this edge. Properties are added in order.- Parameters:
name1
- of first propertyvalue1
- of first propertyname2
- of second propertyvalue2
- of second property- Returns:
- this edge
- Throws:
NullPointerException
- if name or value is null for any of the properties
-
property
Graph.Edge<ID> property(String name1, Object value1, String name2, Object value2, String name3, Object value3)
-
property
Graph.Edge<ID> property(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4)
-
property
Graph.Edge<ID> property(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4, String name5, Object value5)
-
property
Graph.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)
-
property
Graph.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)
-
property
Graph.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)
-
property
Graph.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)
-
property
Graph.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)
-
property
Graph.Edge<ID> property(Map<String,Object> properties)
-
removeProperty
Graph.Edge<ID> removeProperty(String name)
Removes property from local properties returning this edge.- Parameters:
name
- of property- Returns:
- this edge
- Throws:
NullPointerException
- if name is null
-
inherited
Map<String,Object> inherited()
Returns an unmodifiable map of inherited properties- Returns:
- map of inherited properties
-
-