- 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 directed
isDirected()
will return true.-
Method Summary
Modifier and TypeMethodDescriptionReturns ordered pair of endpoint ids.<T> Optional<T>
findProperty
(String name) ReturnsOptional
of a property.from()
Returns vertex id of 'from' endpoint.Sets vertex id of 'from' endpoint.Returns 'from' vertexgetFrom()
Returns vertex id of 'from' endpoint.getId()
Returns optional identifier of this edge.default ID
Returns the opposite endpoint of this edge<T> T
getProperty
(String name) Returns a property.getTo()
Returns vertex id of 'to' endpoint.Sets identifier of this edge.Returns an unmodifiable map of inherited propertiesboolean
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 vertex id of 'from' endpoint.void
Sets identifier of this edge.void
setProperty
(String name, Object value) Sets the value of a local property.void
Sets vertex id of 'to' endpoint.to()
Returns vertex id of 'to' endpoint.Sets vertex id of 'to' endpoint.toVertex()
Returns 'to' vertex
-
Method Details
-
getId
Returns optional identifier of this edge.- Returns:
- optional identifier
-
setId
Sets identifier of this edge.- Parameters:
id
- of edge- Throws:
NullPointerException
- if id is null
-
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
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
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
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
Sets vertex id of 'to' endpoint. If vertex does not exist it is created.- Parameters:
to
- endpoint- Returns:
- this edge
-
endpoints
Returns ordered pair of endpoint ids. 'from' endpoint id is always first followed by 'to' endpoint id.- Returns:
- order pair of endpoints
-
getOppositeEndpoint
Returns the opposite endpoint of this edge- Parameters:
id
- of one endpoint- Returns:
- Throws:
NullPointerException
- if id is nullIllegalArgumentException
- if id is not one of the endpoints of this edge
-
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
-
findProperty
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
-
getProperty
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.
- Type Parameters:
T
- return type of property- Parameters:
name
- of property- Returns:
- value of named property
- Throws:
NullPointerException
- if name is null
-
setProperty
Sets the value of a local property.- Parameters:
name
- of propertyvalue
- of property- Throws:
NullPointerException
- if name or value is null
-
property
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
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
-
property
-
property
-
property
-
property
-
property
-
property
-
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
-
removeProperty
Removes property from local properties returning this edge.- Parameters:
name
- of property- Returns:
- this edge
- Throws:
NullPointerException
- if name is null
-
inherited
Returns an unmodifiable map of inherited properties- Returns:
- map of inherited properties
-
local
Returns an unmodifiable map of local properties- Returns:
- map of local properties
-
remove
Graph.Edge<ID> remove()Removes this edge from the graph.- Returns:
- this edge
-