com.googlecode.whatswrong.javautils
Class Pair<A1,A2>

java.lang.Object
  extended by com.googlecode.whatswrong.javautils.Pair<A1,A2>

public class Pair<A1,A2>
extends java.lang.Object

A Pair is a typed pair of objects.

Author:
Sebastian Riedel

Field Summary
 A1 arg1
          The first argument.
 A2 arg2
          The second argument.
 
Constructor Summary
Pair(A1 arg1, A2 arg2)
          Creates a pair with the given arguments
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks whether both arguments are equal.
 int hashCode()
          Returns a hashcode based on both arguments.
 java.lang.String toString()
          Returns ([arg1],[arg2]) where [arg1] is replaced by the value of the first argument and [arg2] replaced by the value of the second argument.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

arg1

public final A1 arg1
The first argument.


arg2

public final A2 arg2
The second argument.

Constructor Detail

Pair

public Pair(A1 arg1,
            A2 arg2)
Creates a pair with the given arguments

Parameters:
arg1 - First argument.
arg2 - Second argument.
Method Detail

equals

public boolean equals(java.lang.Object o)
Checks whether both arguments are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - the other pair.
Returns:
true iff both arguments are equal.

hashCode

public int hashCode()
Returns a hashcode based on both arguments.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode based on both arguments.

toString

public java.lang.String toString()
Returns ([arg1],[arg2]) where [arg1] is replaced by the value of the first argument and [arg2] replaced by the value of the second argument.

Overrides:
toString in class java.lang.Object
Returns:
the string "([arg1],[arg2])".


Copyright © 2009. All Rights Reserved.