java.lang.Object
org.jgrapht.graph.BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>
org.jgrapht.graph.WeightedIntrusiveEdgesSpecifics<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
Serializable
,IntrusiveEdgesSpecifics<V,
E>
public class WeightedIntrusiveEdgesSpecifics<V,E>
extends BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>
implements IntrusiveEdgesSpecifics<V,E>
A weighted variant of the intrusive edges specifics.
The implementation optimizes the use of DefaultWeightedEdge
and subclasses. For other
custom user edge types, a map is used to store vertex source, target and weight.
- Author:
- Barak Naveh, Dimitrios Michail
- See Also:
-
Field Summary
Fields inherited from class org.jgrapht.graph.BaseIntrusiveEdgesSpecifics
edgeMap, unmodifiableEdgeSet
-
Constructor Summary
ConstructorDescriptionWeightedIntrusiveEdgesSpecifics
(Map<E, org.jgrapht.graph.IntrusiveWeightedEdge> map) Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a new edgedouble
getEdgeWeight
(E e) Get the weight of an edge.protected org.jgrapht.graph.IntrusiveWeightedEdge
Get the intrusive edge of an edge.void
setEdgeWeight
(E e, double weight) Set the weight of an edgeMethods inherited from class org.jgrapht.graph.BaseIntrusiveEdgesSpecifics
addIntrusiveEdge, containsEdge, getEdgeSet, getEdgeSource, getEdgeTarget, remove
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jgrapht.graph.IntrusiveEdgesSpecifics
containsEdge, getEdgeSet, getEdgeSource, getEdgeTarget, remove
-
Constructor Details
-
WeightedIntrusiveEdgesSpecifics
Constructor- Parameters:
map
- the map to use for storage
-
-
Method Details
-
add
Description copied from class:BaseIntrusiveEdgesSpecifics
Add a new edge- Specified by:
add
in interfaceIntrusiveEdgesSpecifics<V,
E> - Specified by:
add
in classBaseIntrusiveEdgesSpecifics<V,
E, org.jgrapht.graph.IntrusiveWeightedEdge> - Parameters:
e
- the edgesourceVertex
- the source vertex of the edgetargetVertex
- the target vertex of the edge- Returns:
- true if the edge was added, false if the edge was already present
-
getEdgeWeight
Description copied from class:BaseIntrusiveEdgesSpecifics
Get the weight of an edge.- Specified by:
getEdgeWeight
in interfaceIntrusiveEdgesSpecifics<V,
E> - Overrides:
getEdgeWeight
in classBaseIntrusiveEdgesSpecifics<V,
E, org.jgrapht.graph.IntrusiveWeightedEdge> - Parameters:
e
- the edge- Returns:
- the weight of an edge
-
setEdgeWeight
Description copied from class:BaseIntrusiveEdgesSpecifics
Set the weight of an edge- Specified by:
setEdgeWeight
in interfaceIntrusiveEdgesSpecifics<V,
E> - Overrides:
setEdgeWeight
in classBaseIntrusiveEdgesSpecifics<V,
E, org.jgrapht.graph.IntrusiveWeightedEdge> - Parameters:
e
- the edgeweight
- the new weight
-
getIntrusiveEdge
Description copied from class:BaseIntrusiveEdgesSpecifics
Get the intrusive edge of an edge.- Specified by:
getIntrusiveEdge
in classBaseIntrusiveEdgesSpecifics<V,
E, org.jgrapht.graph.IntrusiveWeightedEdge> - Parameters:
e
- the edge- Returns:
- the intrusive edge
-