Package generic

# Class DominantPair<K,V>

java.lang.Object
generic.stl.Pair<K,V>
generic.DominantPair<K,V>

Type Parameters:
  `K` - the key type
  `V` - the value type

public class DominantPair<K,V> extends Pair<K,V>
DominantPair is a pair where the key is responsible for equality and hashCode (and the value of the pair doesn't matter at all). This is useful when you need the pair itself to function as a key in a Map or value in a Set.

- ## Field Summary

  ### Fields inherited from class generic.stl.Pair

  `first, second`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DominantPair(K key, V value)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class generic.stl.Pair

  `emptyPair`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DominantPair

    public DominantPair(K key, V value)

- ## Method Details

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Pair<K,V>`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Pair<K,V>`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Pair<K,V>`