org.glassfish.gmbal.generic
Class Pair<S,T>

java.lang.Object
  extended by org.glassfish.gmbal.generic.Pair<S,T>

public class Pair<S,T>
extends Object

A utilitiy class representing a generic types Pair of elements. Useful for simple data structures, returning multiple values, etc. Pair is similar to a cons cell.


Field Summary
protected  S _first
           
protected  T _second
           
 
Constructor Summary
Pair()
           
Pair(S first)
           
Pair(S first, T second)
           
 
Method Summary
 boolean equals(Object obj)
           
 S first()
           
 int hashCode()
           
 T second()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_first

protected S _first

_second

protected T _second
Constructor Detail

Pair

public Pair(S first,
            T second)

Pair

public Pair(S first)

Pair

public Pair()
Method Detail

first

public S first()

second

public T second()

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.