info.jonclark.lang
Class SparseMatrix<T>

java.lang.Object
  extended by info.jonclark.lang.SparseMatrix<T>
All Implemented Interfaces:
Serializable

public class SparseMatrix<T>
extends Object
implements Serializable

A matrix composed of SparseArray objects that minimizes memory consumption for very large matrices when not all elements must be set Created on January 30, 2006

See Also:
Serialized Form

Constructor Summary
SparseMatrix()
           
 
Method Summary
 T get(long nRow, long nCol)
          Get an element of this SparseMatrix
 void set(long nRow, long nCol, T obj)
          Sets an element of this SparseMatrix If the element at the given ID does not already exist, it will be created.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseMatrix

public SparseMatrix()
Method Detail

set

public void set(long nRow,
                long nCol,
                T obj)
Sets an element of this SparseMatrix If the element at the given ID does not already exist, it will be created.

Parameters:
nRow - The row that will be set or created
nCol - The column that will be set or created
obj - The element that will be put at the specified location

get

public T get(long nRow,
             long nCol)
Get an element of this SparseMatrix

Parameters:
nRow - The row at which the object is located
nCol - The column at which the object is located
Returns:
The object at the given location or null if the location has not previously been set