hultig.util
Class MatrixItem

java.lang.Object
  extended by hultig.util.MatrixItem
All Implemented Interfaces:
Comparator

public class MatrixItem
extends Object
implements Comparator

Represents an item from a matrix, with its (i,j) coordinates its respective value (Aij).

Copyright: Copyright (c) 2007

Company: UBI/HULTIG


Constructor Summary
MatrixItem(int i, int j, double aij)
          Creates a matrix object.
 
Method Summary
 double aij()
          Gives the matrix (i,j) position value.
 int compare(Object o1, Object o2)
          The comparator used for sorting.
 int i()
          Gives the matrix i-th (line reference) position, for this item.
 int j()
          Gives the matrix j-th (column reference) position, for this item.
 String toString()
          Converts this item to a string format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

MatrixItem

public MatrixItem(int i,
                  int j,
                  double aij)
Creates a matrix object.

Parameters:
i - The i-th (line) matrix position.
j - The j-th (column) matrix position.
x - double
Method Detail

i

public int i()
Gives the matrix i-th (line reference) position, for this item.

Returns:
The line reference for this item.

j

public int j()
Gives the matrix j-th (column reference) position, for this item.

Returns:
The column reference for this item.

aij

public double aij()
Gives the matrix (i,j) position value.

Returns:
double

compare

public int compare(Object o1,
                   Object o2)
The comparator used for sorting.

Specified by:
compare in interface Comparator
Parameters:
o1 - The first object.
o2 - The second object.
Returns:
Zero if the objects are equal, -1 if o1 < o2, or 1 if o1 > o2.

toString

public String toString()
Converts this item to a string format.

Overrides:
toString in class Object
Returns:
The string representing this item.