Class Graph.Edge<N,E extends Number>
java.lang.Object
util.collection.Graph.Edge<N,E>
- Type Parameters:
N
- the type of nodesE
- the type of edge weight, must extendNumber
Edge represents a connection between two nodes in the graph, possibly with a weight and additional properties.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an edge with specified nodes, no weight or properties.Constructs an edge with specified nodes and weight, no properties.Constructs an edge with specified nodes, weight, and properties.Constructs an edge with specified nodes and properties, no weight. -
Method Summary
Modifier and TypeMethodDescriptiongetFrom()
Returns the source node of the edge.<T> T
getProperty
(String property, Class<T> clazz) Returns the value of a property for this edge, cast to the specified type.getTo()
Returns the destination node of the edge.double
Returns the weight of the edge as a double.
-
Constructor Details
-
Edge
-
Edge
-
Edge
-
Edge
-
-
Method Details
-
getFrom
-
getTo
-
getWeight
public double getWeight()Returns the weight of the edge as a double.- Returns:
- the weight of the edge as a double, or 0.0 if the weight is null
-
getProperty
Returns the value of a property for this edge, cast to the specified type.- Type Parameters:
T
- the type of the property value- Parameters:
property
- the property nameclazz
- the class of the property value- Returns:
- the property value cast to the specified type
-