V
- the graph vertex typeE
- the graph edge typepublic class WeightedIntrusiveEdgesSpecifics<V,E> extends BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge> implements IntrusiveEdgesSpecifics<V,E>
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.
edgeMap, unmodifiableEdgeSet
Constructor and Description |
---|
WeightedIntrusiveEdgesSpecifics()
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e,
V sourceVertex,
V targetVertex)
Add a new edge
|
double |
getEdgeWeight(E e)
Get the weight of an edge.
|
protected org.jgrapht.graph.IntrusiveWeightedEdge |
getIntrusiveEdge(E e)
Get the intrusive edge of an edge.
|
void |
setEdgeWeight(E e,
double weight)
Set the weight of an edge
|
containsEdge, getEdgeSet, getEdgeSource, getEdgeTarget, remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsEdge, getEdgeSet, getEdgeSource, getEdgeTarget, remove
public WeightedIntrusiveEdgesSpecifics()
public boolean add(E e, V sourceVertex, V targetVertex)
BaseIntrusiveEdgesSpecifics
add
in interface IntrusiveEdgesSpecifics<V,E>
add
in class BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>
e
- the edgesourceVertex
- the source vertex of the edgetargetVertex
- the target vertex of the edgepublic double getEdgeWeight(E e)
BaseIntrusiveEdgesSpecifics
getEdgeWeight
in interface IntrusiveEdgesSpecifics<V,E>
getEdgeWeight
in class BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>
e
- the edgepublic void setEdgeWeight(E e, double weight)
BaseIntrusiveEdgesSpecifics
setEdgeWeight
in interface IntrusiveEdgesSpecifics<V,E>
setEdgeWeight
in class BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>
e
- the edgeweight
- the new weightprotected org.jgrapht.graph.IntrusiveWeightedEdge getIntrusiveEdge(E e)
BaseIntrusiveEdgesSpecifics
getIntrusiveEdge
in class BaseIntrusiveEdgesSpecifics<V,E,org.jgrapht.graph.IntrusiveWeightedEdge>
e
- the edgeCopyright © 2018. All rights reserved.