net.sf.sdedit.util
Class Pair<F,S>

java.lang.Object
  extended by net.sf.sdedit.util.Pair<F,S>
Type Parameters:
F - the type of the first entry of the pair
S - the type of the second entry of the pair

public class Pair<F,S>
extends Object

Pair objects can hold two objects of types F and S


Constructor Summary
Pair(F first, S second)
          Creates a new Pair
 
Method Summary
 boolean equals(Object object)
          Returns true iff both elements of this Pair equal both elements of another Pair.
 F getFirst()
          Returns the first object
 S getSecond()
          Returns the second object
 int hashCode()
          Returns this Pair's hash code, of which the 16 high bits are the 16 low bits of getFirst().hashCode() are identical to the 16 low bits and the 16 low bits of getSecond().hashCode()
 void setFirst(F first)
          Sets the first object.
 void setSecond(S second)
          Sets the second object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pair

public Pair(F first,
            S second)
Creates a new Pair

Parameters:
first - the first object
second - the second object
Method Detail

getFirst

public F getFirst()
Returns the first object

Returns:
the first object

getSecond

public S getSecond()
Returns the second object

Returns:
the second object

setFirst

public void setFirst(F first)
Sets the first object.

Parameters:
first - the first object of the pair

setSecond

public void setSecond(S second)
Sets the second object.

Parameters:
second - the second object of the pair

hashCode

public int hashCode()
Returns this Pair's hash code, of which the 16 high bits are the 16 low bits of getFirst().hashCode() are identical to the 16 low bits and the 16 low bits of getSecond().hashCode()

Overrides:
hashCode in class Object
Returns:
this Pair's hash code, composed of its two elements' hash codes as described above

equals

public boolean equals(Object object)
Returns true iff both elements of this Pair equal both elements of another Pair.

Overrides:
equals in class Object
Parameters:
object - object reference to another Pair
Returns:
true iff both elements of this Pair equal both elements of another Pair

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2011. All Rights Reserved.