Class Pair<E,F>

java.lang.Object
tools.Pair<E,F>
Type Parameters:
E - The type of the left value.
F - The type of the right value.
All Implemented Interfaces:
Serializable

public class Pair<E,F> extends Object implements Serializable
Represents a pair of values.
Since:
Revision 333
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(E left, F right)
    Class constructor - pairs two objects together.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks to see if two pairs are equal.
    Gets the left value.
    Gets the right value.
    int
    Gets the hash code of this pair.
    Turns the pair into a string.

    Methods inherited from class Object

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

    • left

      public E left
  • Constructor Details

    • Pair

      public Pair(E left, F right)
      Class constructor - pairs two objects together.
      Parameters:
      left - The left object.
      right - The right object.
  • Method Details

    • getLeft

      public E getLeft()
      Gets the left value.
      Returns:
      The left value.
    • getRight

      public F getRight()
      Gets the right value.
      Returns:
      The right value.
    • toString

      public String toString()
      Turns the pair into a string.
      Overrides:
      toString in class Object
      Returns:
      Each value of the pair as a string joined by a colon.
    • hashCode

      public int hashCode()
      Gets the hash code of this pair.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Checks to see if two pairs are equal.
      Overrides:
      equals in class Object