Class Pair<T1,T2>

java.lang.Object
org.tweetyproject.arg.adf.util.Pair<T1,T2>
Type Parameters:
T1 - type
T2 - type

public final class Pair<T1,T2> extends Object
Pair class
Author:
Mathias Hofer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final T1
    first
    final T2
    second
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(T1 first, T2 second)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    static <T1, T2> Pair<T1,T2>
    of(T1 a, T2 b)
    Creates a new Pair consisting of two elements.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • first

      public final T1 first
      first
    • second

      public final T2 second
      second
  • Constructor Details

    • Pair

      public Pair(T1 first, T2 second)
      Constructor
      Parameters:
      first - some element
      second - some element
  • Method Details

    • of

      public static <T1, T2> Pair<T1,T2> of(T1 a, T2 b)
      Creates a new Pair consisting of two elements.

      This method is a convenience factory method that constructs a Pair from the two provided elements.

      Type Parameters:
      T1 - The type of the first element in the pair.
      T2 - The type of the second element in the pair.
      Parameters:
      a - The first element of the pair.
      b - The second element of the pair.
      Returns:
      A Pair<T1, T2> containing the two specified elements.
    • hashCode

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

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