slib.utils
Class Pair<TYPEA,TYPEB>

java.lang.Object
  extended by slib.utils.Pair<TYPEA,TYPEB>
Type Parameters:
TYPEA -
TYPEB -
All Implemented Interfaces:
Comparable<Pair<TYPEA,TYPEB>>

public class Pair<TYPEA,TYPEB>
extends Object
implements Comparable<Pair<TYPEA,TYPEB>>

Author:
http://stackoverflow.com/questions/779414/java-generics-pairstring-string-stored-in-hashmap-not-retrieving-key-value-p

Field Summary
protected  TYPEA Key_
           
protected  TYPEB Value_
           
 
Constructor Summary
Pair(TYPEA key, TYPEB value)
           
 
Method Summary
 int compareTo(Pair<TYPEA,TYPEB> p1)
           
 boolean equals(Object obj)
           
 TYPEA getKey()
           
 TYPEB getValue()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Key_

protected final TYPEA Key_

Value_

protected final TYPEB Value_
Constructor Detail

Pair

public Pair(TYPEA key,
            TYPEB value)
Method Detail

getKey

public TYPEA getKey()

getValue

public TYPEB getValue()

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Pair<TYPEA,TYPEB> p1)
Specified by:
compareTo in interface Comparable<Pair<TYPEA,TYPEB>>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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


Copyright © 2013. All Rights Reserved.