java.lang.Object
java.util.EventObject
org.jgrapht.event.GraphChangeEvent
org.jgrapht.event.GraphEdgeChangeEvent<V,E>
- Type Parameters:
V
- the graph vertex typeE
- the graph edge type
- All Implemented Interfaces:
java.io.Serializable
public class GraphEdgeChangeEvent<V,E> extends GraphChangeEvent
An event which indicates that a graph edge has changed, or is about to change. The event can be
used either as an indication after the edge has been added or removed, or before it
is added. The type of the event can be tested using the
GraphChangeEvent.getType()
method.- Author:
- Barak Naveh
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static int
BEFORE_EDGE_ADDED
Before edge added event.static int
BEFORE_EDGE_REMOVED
Before edge removed event.protected E
edge
The edge that this event is related to.static int
EDGE_ADDED
Edge added event.static int
EDGE_REMOVED
Edge removed event.static int
EDGE_WEIGHT_UPDATED
Edge weight updated event.protected V
edgeSource
The source vertex of the edge that this event is related to.protected V
edgeTarget
The target vertex of the edge that this event is related to.protected double
edgeWeight
The weight of the edge that this event is related to. -
Constructor Summary
Constructors Constructor Description GraphEdgeChangeEvent(java.lang.Object eventSource, int type, E edge, V edgeSource, V edgeTarget)
Constructor for GraphEdgeChangeEvent.GraphEdgeChangeEvent(java.lang.Object eventSource, int type, E edge, V edgeSource, V edgeTarget, double edgeWeight)
Constructor for GraphEdgeChangeEvent. -
Method Summary
Modifier and Type Method Description E
getEdge()
Returns the edge that this event is related to.V
getEdgeSource()
Returns the source vertex that this event is related to.V
getEdgeTarget()
Returns the target vertex that this event is related to.double
getEdgeWeight()
Returns the weight of the edge that this event is related to.
-
Field Details
-
BEFORE_EDGE_ADDED
public static final int BEFORE_EDGE_ADDEDBefore edge added event. This event is fired before an edge is added to a graph.- See Also:
- Constant Field Values
-
BEFORE_EDGE_REMOVED
public static final int BEFORE_EDGE_REMOVEDBefore edge removed event. This event is fired before an edge is removed from a graph.- See Also:
- Constant Field Values
-
EDGE_ADDED
public static final int EDGE_ADDEDEdge added event. This event is fired after an edge is added to a graph.- See Also:
- Constant Field Values
-
EDGE_REMOVED
public static final int EDGE_REMOVEDEdge removed event. This event is fired after an edge is removed from a graph.- See Also:
- Constant Field Values
-
EDGE_WEIGHT_UPDATED
public static final int EDGE_WEIGHT_UPDATEDEdge weight updated event. This event is fired after an edge weight is updated in a graph.- See Also:
- Constant Field Values
-
edge
The edge that this event is related to. -
edgeSource
The source vertex of the edge that this event is related to. -
edgeTarget
The target vertex of the edge that this event is related to. -
edgeWeight
protected double edgeWeightThe weight of the edge that this event is related to.
-
-
Constructor Details
-
GraphEdgeChangeEvent
public GraphEdgeChangeEvent(java.lang.Object eventSource, int type, E edge, V edgeSource, V edgeTarget)Constructor for GraphEdgeChangeEvent.- Parameters:
eventSource
- the source of this event.type
- the event type of this event.edge
- the edge that this event is related to.edgeSource
- edge source vertexedgeTarget
- edge target vertex
-
GraphEdgeChangeEvent
public GraphEdgeChangeEvent(java.lang.Object eventSource, int type, E edge, V edgeSource, V edgeTarget, double edgeWeight)Constructor for GraphEdgeChangeEvent.- Parameters:
eventSource
- the source of this event.type
- the event type of this event.edge
- the edge that this event is related to.edgeSource
- edge source vertexedgeTarget
- edge target vertexedgeWeight
- edge weight
-
-
Method Details
-
getEdge
Returns the edge that this event is related to.- Returns:
- event edge
-
getEdgeSource
Returns the source vertex that this event is related to.- Returns:
- event source vertex
-
getEdgeTarget
Returns the target vertex that this event is related to.- Returns:
- event target vertex
-
getEdgeWeight
public double getEdgeWeight()Returns the weight of the edge that this event is related to.- Returns:
- event edge weight
-