Package org.jgrapht.graph
Class WeightedIntrusiveEdgesSpecifics<V,E>
- 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
DefaultWeightedEdgeand 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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.jgrapht.graph.BaseIntrusiveEdgesSpecifics
edgeMap, unmodifiableEdgeSet
-
-
Constructor Summary
Constructors Constructor Description WeightedIntrusiveEdgesSpecifics(Map<E,org.jgrapht.graph.IntrusiveWeightedEdge> map)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e, V sourceVertex, V targetVertex)Add a new edgedoublegetEdgeWeight(E e)Get the weight of an edge.protected org.jgrapht.graph.IntrusiveWeightedEdgegetIntrusiveEdge(E e)Get the intrusive edge of an edge.voidsetEdgeWeight(E e, double weight)Set the weight of an edge-
Methods inherited from class org.jgrapht.graph.BaseIntrusiveEdgesSpecifics
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
-
-
-
-
Method Detail
-
add
public boolean add(E e, V sourceVertex, V targetVertex)
Description copied from class:BaseIntrusiveEdgesSpecificsAdd a new edge- Specified by:
addin interfaceIntrusiveEdgesSpecifics<V,E>- Specified by:
addin 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
public double getEdgeWeight(E e)
Description copied from class:BaseIntrusiveEdgesSpecificsGet the weight of an edge.- Specified by:
getEdgeWeightin interfaceIntrusiveEdgesSpecifics<V,E>- Overrides:
getEdgeWeightin classBaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>- Parameters:
e- the edge- Returns:
- the weight of an edge
-
setEdgeWeight
public void setEdgeWeight(E e, double weight)
Description copied from class:BaseIntrusiveEdgesSpecificsSet the weight of an edge- Specified by:
setEdgeWeightin interfaceIntrusiveEdgesSpecifics<V,E>- Overrides:
setEdgeWeightin classBaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>- Parameters:
e- the edgeweight- the new weight
-
getIntrusiveEdge
protected org.jgrapht.graph.IntrusiveWeightedEdge getIntrusiveEdge(E e)
Description copied from class:BaseIntrusiveEdgesSpecificsGet the intrusive edge of an edge.- Specified by:
getIntrusiveEdgein classBaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>- Parameters:
e- the edge- Returns:
- the intrusive edge
-
-