Class Pair<U,V>

java.lang.Object
org.jppf.utils.Pair<U,V>
Type Parameters:
U - the type of the first element in the pair.
V - the type of the second element in the pair.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BundleWithTasks, HostIP

public class Pair<U,V> extends Object implements Serializable
Utility class holding a pair of references to two objects.
Author:
Laurent Cohen
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final U
    The first object of this pair.
    protected final V
    The second object of this pair.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pair(U first, V second)
    Initialize this pair with two values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Get the first value of this pair.
    int
     
    Get the left-side value of this pair.
    Get the right-side value of this pair.
    Get the second value of this pair.
     

    Methods inherited from class java.lang.Object

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

    • first

      protected final U first
      The first object of this pair.
    • second

      protected final V second
      The second object of this pair.
  • Constructor Details

    • Pair

      public Pair(U first, V second)
      Initialize this pair with two values.
      Parameters:
      first - the first value of the new pair.
      second - the second value of the new pair.
  • Method Details

    • first

      public U first()
      Get the first value of this pair.
      Returns:
      an object of type U.
    • second

      public V second()
      Get the second value of this pair.
      Returns:
      an object of type V.
    • left

      public U left()
      Get the left-side value of this pair.
      Returns:
      an object of type U.
    • right

      public V right()
      Get the right-side value of this pair.
      Returns:
      an object of type V.
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object