Class DefaultWeightedEdge<V,W>

java.lang.Object
org.episteme.core.mathematics.discrete.DefaultWeightedEdge<V,W>
Type Parameters:
V - the type of vertices
W - the type of weights * @author Silvere Martin-Michiellot
All Implemented Interfaces:
WeightedEdge<V,W>

public final class DefaultWeightedEdge<V,W> extends Object implements WeightedEdge<V,W>
Default implementation of a weighted edge.
Since:
1.0
Author:
Gemini AI (Google DeepMind)
  • Constructor Details

    • DefaultWeightedEdge

      public DefaultWeightedEdge(V source, V target, W weight)
      Creates a new weighted edge.
      Parameters:
      source - the source vertex
      target - the target vertex
      weight - the edge weight
  • Method Details

    • getSource

      public V getSource()
      Description copied from interface: WeightedEdge
      Returns the source vertex of this edge.
      Specified by:
      getSource in interface WeightedEdge<V,W>
      Returns:
      the source vertex
    • getTarget

      public V getTarget()
      Description copied from interface: WeightedEdge
      Returns the target vertex of this edge.
      Specified by:
      getTarget in interface WeightedEdge<V,W>
      Returns:
      the target vertex
    • getWeight

      public W getWeight()
      Description copied from interface: WeightedEdge
      Returns the weight of this edge.
      Specified by:
      getWeight in interface WeightedEdge<V,W>
      Returns:
      the edge weight
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object