sbrt.kernel.math.algebra
Class IndexPair<R,C>

java.lang.Object
  extended by sbrt.kernel.math.algebra.IndexPair<R,C>
Type Parameters:
R - the row index type.
C - the column index type.

public final class IndexPair<R,C>
extends java.lang.Object

This class is used to represent pairs of matrix indices.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
IndexPair(S rowIndex, T columnIndex)
          Constructs a new pair of matrix indices.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates if this index pair is equal to the provided object.
 C getColumnIndex()
          Returns the column index.
 R getRowIndex()
          Returns the row index.
 int hashCode()
          Returns a content-based hash code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexPair

public IndexPair(S rowIndex,
                 T columnIndex)
Constructs a new pair of matrix indices.

Type Parameters:
S - a type extending the primary row type.
T - a type extending the primary column type.
Parameters:
rowIndex - the row index.
columnIndex - the column index.
Method Detail

getRowIndex

public R getRowIndex()
Returns the row index.

Returns:
the row index.

getColumnIndex

public C getColumnIndex()
Returns the column index.

Returns:
the column index.

hashCode

public int hashCode()
Returns a content-based hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
a content-based hash code.

equals

public boolean equals(java.lang.Object obj)
Indicates if this index pair is equal to the provided object. Two index pairs are equal if their row and column indices are equal, respectively.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this index pair equals the provided object; false otherwise.