org.objectweb.jac.util
Class Matrix

java.lang.Object
  extended byorg.objectweb.jac.util.Matrix

public class Matrix
extends Object

This class represents a wrappable matrix of object

The implementation is simple and not optimized.


Constructor Summary
Matrix()
           
Matrix(int cCount, int rCount)
           
 
Method Summary
 void allocate(int cCount, int rCount)
          Sets the number of columns and the number of rows.
 Object get(int i, int j)
          Gets an element in the matrix.
 int getColumnCount()
          Gets column count.
 int getRowCount()
          Gets the row count.
 void set(int i, int j, Object value)
          Inserts an element in the matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix()

Matrix

public Matrix(int cCount,
              int rCount)
Method Detail

allocate

public void allocate(int cCount,
                     int rCount)
Sets the number of columns and the number of rows.

Old data is discarded and all cells are set to null

Parameters:
cCount - number of columns
rCount - number of rows

set

public void set(int i,
                int j,
                Object value)
         throws IndexOutOfBoundsException
Inserts an element in the matrix.

Parameters:
i - the row of insertion
j - the columm of insertion
value - the object to insert in the matrix
Throws:
IndexOutOfBoundsException

get

public Object get(int i,
                  int j)
           throws IndexOutOfBoundsException
Gets an element in the matrix.

Parameters:
i - the row
j - the columm
Returns:
value the element at the given place
Throws:
IndexOutOfBoundsException

getRowCount

public int getRowCount()
Gets the row count.


getColumnCount

public int getColumnCount()
Gets column count.