net.ajaest.lib.data
Class Pair<E1,E2>

java.lang.Object
  extended by net.ajaest.lib.data.Pair<E1,E2>
Type Parameters:
E1 - First element
E2 - Second element
Direct Known Subclasses:
KanjiStrokeClue

public class Pair<E1,E2>
extends java.lang.Object

Generic class that stores two elements.

Author:
Luis Alfonso Arce González

Field Summary
private  E1 first
           
private  E2 second
           
 
Constructor Summary
Pair(E1 first, E2 second)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 E1 getFirst()
          Returns the first element.Read the constructor or class info for further information about the meaning of "first".
 E2 getSecond()
          Returns the second element.Read the constructor or class info for further information about the meaning of "second".
 int hashCode()
           
 void setFirst(E1 first)
          Stores the first element overriding the previous one.Read the constructor or class info for further information about the meaning of "first".
 void setSecond(E2 second)
          Stores the second element replacing any element stored before.Read the constructor or class info for further information about the meaning of "second".
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

first

private E1 first

second

private E2 second
Constructor Detail

Pair

public Pair(E1 first,
            E2 second)
Method Detail

getFirst

public E1 getFirst()
Returns the first element.Read the constructor or class info for further information about the meaning of "first".


setFirst

public void setFirst(E1 first)
Stores the first element overriding the previous one.Read the constructor or class info for further information about the meaning of "first".

Parameters:
first -

getSecond

public E2 getSecond()
Returns the second element.Read the constructor or class info for further information about the meaning of "second".


setSecond

public void setSecond(E2 second)
Stores the second element replacing any element stored before.Read the constructor or class info for further information about the meaning of "second".

Parameters:
second -

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object