Module org.jgrapht.core
Package org.jgrapht.graph
Class BaseIntrusiveEdgesSpecifics<V,E,IE extends org.jgrapht.graph.IntrusiveEdge>
java.lang.Object
org.jgrapht.graph.BaseIntrusiveEdgesSpecifics<V,E,IE>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge typeIE
- the intrusive edge type
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
UniformIntrusiveEdgesSpecifics
,WeightedIntrusiveEdgesSpecifics
public abstract class BaseIntrusiveEdgesSpecifics<V,E,IE extends org.jgrapht.graph.IntrusiveEdge>
extends java.lang.Object
implements java.io.Serializable
A base implementation for the intrusive edges specifics.
- Author:
- Barak Naveh, Dimitrios Michail
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<E,IE>
edgeMap
protected java.util.Set<E>
unmodifiableEdgeSet
-
Constructor Summary
Constructors Constructor Description BaseIntrusiveEdgesSpecifics(java.util.Map<E,IE> edgeMap)
Constructor -
Method Summary
Modifier and Type Method Description abstract boolean
add(E e, V sourceVertex, V targetVertex)
Add a new edgeprotected boolean
addIntrusiveEdge(E edge, V sourceVertex, V targetVertex, IE e)
boolean
containsEdge(E e)
Check if an edge existsjava.util.Set<E>
getEdgeSet()
Get the edge set.V
getEdgeSource(E e)
Get the source of an edge.V
getEdgeTarget(E e)
Get the target of an edge.double
getEdgeWeight(E e)
Get the weight of an edge.protected abstract IE
getIntrusiveEdge(E e)
Get the intrusive edge of an edge.void
remove(E e)
Remove an edge.void
setEdgeWeight(E e, double weight)
Set the weight of an edge
-
Field Details
-
Constructor Details
-
BaseIntrusiveEdgesSpecifics
Constructor- Parameters:
edgeMap
- the map to use for storage
-
-
Method Details
-
containsEdge
Check if an edge exists- Parameters:
e
- the edge- Returns:
- true if the edge exists, false otherwise
-
getEdgeSet
Get the edge set.- Returns:
- an unmodifiable edge set
-
remove
Remove an edge.- Parameters:
e
- the edge
-
getEdgeSource
Get the source of an edge.- Parameters:
e
- the edge- Returns:
- the source vertex of an edge
-
getEdgeTarget
Get the target of an edge.- Parameters:
e
- the edge- Returns:
- the target vertex of an edge
-
getEdgeWeight
Get the weight of an edge.- Parameters:
e
- the edge- Returns:
- the weight of an edge
-
setEdgeWeight
Set the weight of an edge- Parameters:
e
- the edgeweight
- the new weight
-
add
Add a new edge- 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
-
addIntrusiveEdge
-
getIntrusiveEdge
Get the intrusive edge of an edge.- Parameters:
e
- the edge- Returns:
- the intrusive edge
-