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:
java.lang.Iterable<T>

public class PairOfSameType<T>
extends java.lang.Object
implements java.lang.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(java.lang.Object other)
           
 T getFirst()
          Return the first element stored in the pair.
 T getSecond()
          Return the second element stored in the pair.
 int hashCode()
           
 java.util.Iterator<T> iterator()
           
 java.lang.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(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

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

toString

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

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>


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