org.jgrapht.alg.util

## Class Pair<A,B>

- java.lang.Object
- - org.jgrapht.alg.util.Pair<A,B>

-     public class Pair<A,B>
      extends Object

  Generic pair.
  Although the instances of this class are immutable, it is impossible to ensure that the references passed to the constructor will not be modified by the caller.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `A` | `first`
    `B` | `second`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Pair(A a, B b)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object other)`
    `int` | `hashCode()`
    `static <A,B> Pair<A,B>` | `of(A a, B b)` Creates new pair of elements pulling of the necessity to provide corresponding types of the elements supplied

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

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

- - ### Field Detail

    - #### first

          public A first

    - #### second

          public B second

  - ### Constructor Detail

    - #### Pair

          public Pair(A a,
              B b)

  - ### Method Detail

    - #### equals

          public boolean equals(Object other)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### of

          public static <A,B> Pair<A,B> of(A a,
                           B b)

      Creates new pair of elements pulling of the necessity to provide corresponding types of the elements supplied
      Parameters:
        `a` - first element
        `b` - second element
      Returns:
        new pair

Copyright © 2016. All rights reserved.