org.jppf.utils
Class Pair<U,V>

java.lang.Object
  extended by 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:
AbstractNodeIO.BufferList, ChannelBundlePair, HostPort, JPPFSystemInformation.HostIP, JPPFTimeout, NetworkUtils.SubnetInformation

public class Pair<U,V>
extends Object
implements Serializable

Utility class holding a pair of references to two objects.

Author:
Laurent Cohen
See Also:
Serialized Form

Constructor Summary
Pair(U first, V second)
          Initialize this pair with two values.
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 U first()
          Get the first value of this pair.
 int hashCode()
          Get the hashcode for this object.
 V second()
          Get the second value of this pair.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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.

hashCode

public int hashCode()
Get the hashcode for this object.

Overrides:
hashCode in class Object
Returns:
the hashcode as an int value.
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj.
See Also:
Object.equals(java.lang.Object)


Copyright © 2005-2010 JPPF Team.