org.apache.hadoop.hbase.util
Class PairOfSameType<T>

java.lang.Object
  extended by org.apache.hadoop.hbase.util.PairOfSameType<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterable<T>

public class PairOfSameType<T>
extends Object
implements Iterable<T>

A generic, immutable class for pairs of objects both of type T.

See Also:
if Types differ.

Constructor Summary
PairOfSameType(T a, T b)
          Constructor
 
Method Summary
 boolean equals(Object other)
           
 T getFirst()
          Return the first element stored in the pair.
 T getSecond()
          Return the second element stored in the pair.
 int hashCode()
           
 Iterator<T> iterator()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PairOfSameType

public PairOfSameType(T a,
                      T b)
Constructor

Parameters:
a - operand
b - operand
Method Detail

getFirst

public T getFirst()
Return the first element stored in the pair.

Returns:
T

getSecond

public T getSecond()
Return the second element stored in the pair.

Returns:
T

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.