java.lang.Object
io.github.tigerbotics7125.tigerlib.math.graph.Vertex<T>

public class Vertex<T> extends Object
A generic class which holds data for a graph.
Since:
2023
  • Constructor Details

    • Vertex

      public Vertex(T data)
      Creates a new Vertex.
      Parameters:
      data - The data to store, it must implement a valid equals and hashCode method.
  • Method Details

    • of

      public static <T> Vertex<T> of(T data)
      A shortcut for the constructor.
      Type Parameters:
      T - Type of the returned Vertex.
      Parameters:
      data - The data to store, it must implement a valid equals and hashCode method.
      Returns:
    • getData

      public T getData()
      Returns:
      The data stored in this Vertex.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object