Class Graph.Edge

java.lang.Object
ca.uqac.lif.cep.graphviz.Graph.Edge
Enclosing class:
Graph

public static class Graph.Edge extends Object
A weighted directed edge in a graph.
  • Field Details

    • m_weight

      protected float m_weight
      The weight of an edge
    • m_source

      protected int m_source
      The source vertex
    • m_destination

      protected int m_destination
      The destination vertex
  • Constructor Details

    • Edge

      protected Edge(int source, int destination, float weight)
      Creates a new edge
      Parameters:
      source - The source vertex
      destination - The destination vertex
      weight - The edge's weight
  • Method Details

    • duplicate

      public Graph.Edge duplicate()
      Creates a deep copy of the edge
      Returns:
      A copy of the edge
    • duplicate

      public Graph.Edge duplicate(boolean with_state)
      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()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object