Class Pair<K,V>

java.lang.Object
io.github.cvc5.Pair<K,V>
Type Parameters:
K - the type of the first element
V - the type of the second element

public class Pair<K,V> extends Object
A simple generic container class to hold a pair of objects.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The first element of the pair.
    The second element of the pair.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(K first, V second)
    Construct a new Pair with the given values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object pair)
    Compare this Pair to the specified object for equality.
    int
    Return a hash code value for this pair.

    Methods inherited from class java.lang.Object

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

    • first

      public K first
      The first element of the pair.
    • second

      public V second
      The second element of the pair.
  • Constructor Details

    • Pair

      public Pair(K first, V second)
      Construct a new Pair with the given values.
      Parameters:
      first - the first element of the pair
      second - the second element of the pair
  • Method Details

    • equals

      public boolean equals(Object pair)
      Compare this Pair to the specified object for equality. It returns true if the given object is also a Pair and both the first and second elements are equal. Elements are compared with Objects.equals(Object, Object), so null elements are permitted and compare equal to each other.
      Overrides:
      equals in class Object
      Parameters:
      pair - the object to compare with this pair
      Returns:
      true if the specified object is equal to this pair, false otherwise
    • hashCode

      public int hashCode()
      Return a hash code value for this pair. The hash code is derived from the hash codes of the first and second elements, so that pairs that are equal according to equals(Object) have the same hash code.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this pair