Class SimpleGraph.SimpleEdge<T extends IDable,M>

java.lang.Object
dev.roanh.gmark.util.SimpleGraph.SimpleEdge<T,M>
Type Parameters:
T - The graph data type.
M - The metadata data type.
Enclosing class:
SimpleGraph<T extends IDable,M>

public static final class SimpleGraph.SimpleEdge<T extends IDable,M> extends Object
Represents a single undirected edge between two nodes in the graph.
  • Field Details

    • v1

      private final SimpleGraph.SimpleVertex<T extends IDable,M> v1
      The first end point of this edge.
    • v2

      private final SimpleGraph.SimpleVertex<T extends IDable,M> v2
      The second end point of this edge.
    • metadata

      private M metadata
      The metadata stored at this edge.
    • hashcode

      private int hashcode
      The cached hashcode for this edge.
  • Constructor Details

  • Method Details

    • getMetadata

      public M getMetadata()
      Gets the metadata stored at this edge.
      Returns:
      The metadata stored at this edge.
    • setMetadata

      public void setMetadata(M meta)
      Sets the metadata stored at this edge.
      Parameters:
      meta - The new metadata to store at this edge.
    • getFirstVertex

      public SimpleGraph.SimpleVertex<T,M> getFirstVertex()
      Gets the first end point vertex for this end.
      Returns:
      The first vertex for this edge.
    • getSecondVertex

      public SimpleGraph.SimpleVertex<T,M> getSecondVertex()
      Gets the second end point vertex for this end.
      Returns:
      The second vertex for this edge.
    • getTarget

      public SimpleGraph.SimpleVertex<T,M> getTarget(SimpleGraph.SimpleVertex<T,M> source)
      Gets the target vertex for this edge given the source vertex. The given vertex is assumed to be one of the end point vertices of this edge and the returned vertex will be the other end point vertex of this edge.
      Parameters:
      source - The source vertex to use to determine the target vertex.
      Returns:
      The target vertex of this edge from the point of view of the source vertex.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object