Package ca.uqac.lif.cep.graphviz
Class Graph.Edge
java.lang.Object
ca.uqac.lif.cep.graphviz.Graph.Edge
- Enclosing class:
Graph
A weighted directed edge in a graph.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe destination vertexprotected intThe source vertexprotected floatThe weight of an edge -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEdge(int source, int destination, float weight) Creates a new edge -
Method Summary
-
Field Details
-
m_weight
protected float m_weightThe weight of an edge -
m_source
protected int m_sourceThe source vertex -
m_destination
protected int m_destinationThe destination vertex
-
-
Constructor Details
-
Edge
protected Edge(int source, int destination, float weight) Creates a new edge- Parameters:
source- The source vertexdestination- The destination vertexweight- The edge's weight
-
-
Method Details
-
duplicate
Creates a deep copy of the edge- Returns:
- A copy of the edge
-
duplicate
Creates a deep copy of the edge- Parameters:
with_state- Has no effect- Returns:
- A copy of the edge
-
getWeight
public float getWeight()Gets the weight of an edge- Returns:
- The weight
-
getDestination
public int getDestination()Gets the destination vertex of the edge.- Returns:
- The vertex ID
-
getSource
public int getSource()Gets the source vertex of the edge.- Returns:
- The vertex ID
-
hashCode
public int hashCode() -
equals
-
toString
-