Class Pair<A,​B>

java.lang.Object
edu.wpi.first.math.Pair<A,​B>
Type Parameters:
A - The first object's type.
B - The second object's type.

public class Pair<A,​B>
extends Object
Represents a pair of two objects.
  • Constructor Details

    • Pair

      public Pair​(A first, B second)
      Constructs a pair.
      Parameters:
      first - The first object.
      second - The second object.
  • Method Details

    • getFirst

      public A getFirst()
      Returns the first object.
      Returns:
      The first object.
    • getSecond

      public B getSecond()
      Returns the second object.
      Returns:
      The second object.
    • of

      public static <A,​ B> Pair<A,​B> of​(A a, B b)
      Returns a pair comprised of the two given objects.
      Type Parameters:
      A - The first object's type.
      B - The second object's type.
      Parameters:
      a - The first object.
      b - The second object.
      Returns:
      A pair comprised of the two given objects.