|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.umd.cfar.lamp.viper.util.PackedMatrix
This class implements a simple 2-dimensional matrix as a wrapper around a standard java 2-dimensional array.
MatrixIndexOutOfBoundsException| Constructor Summary | |
PackedMatrix(DataMatrix2d old,
java.util.BitSet cols,
java.util.BitSet rows)
Creates a new PackedMatrix, carving out from
an old one. |
|
PackedMatrix(int maxWidth,
int maxHeight)
Constructs a new matrix with the given dimensions. |
|
PackedMatrix(int maxWidth,
int maxHeight,
java.lang.Class type)
This constructor is necessary if you want getDataModel to return
an array of a specific type instead of Object[][]. |
|
PackedMatrix(java.lang.Object[][] data)
Constructs a new PackedMatrix as a wrapper around the given 2-dimensional array. |
|
| Method Summary | |
java.lang.Object |
get(int column,
int row)
Returns the object at the given location. |
java.lang.Object[][] |
getDataModel()
Get the java array used to internally represent this matrix. |
MatrixIterator |
getMatrixIterator()
Returns a MatrixIterator for this matrix. |
int |
height()
Returns the current real height, that is, the largest row number (+1) that contains data. |
java.lang.Object |
remove(int column,
int row)
Sets the object at the specified location to null. |
void |
set(int column,
int row,
java.lang.Object data)
Sets the data at the specific location to the given value. |
int |
sizeHigh()
Get the logical height of the matrix. |
int |
sizeWide()
Get the logical width of the matrix. |
int |
width()
Returns the current real height, that is, the index of the rightmost column that contains data +1. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PackedMatrix(java.lang.Object[][] data)
data - The array to wrap.
public PackedMatrix(int maxWidth,
int maxHeight,
java.lang.Class type)
getDataModel to return
an array of a specific type instead of Object[][].
maxWidth - The number of columns to have in the matrix.maxHeight - The number of rows to have in the matrix.type - The class object specifying the type of object stored here.
public PackedMatrix(int maxWidth,
int maxHeight)
maxWidth - The number of columns to have in the matrix.maxHeight - The number of rows to have in the matrix.
public PackedMatrix(DataMatrix2d old,
java.util.BitSet cols,
java.util.BitSet rows)
PackedMatrix, carving out from
an old one. Logically, it creates a matrix of the count
of all set bits in cols wide and the count
of all set bits in rows high, and fills it
with the data from those rows and columns in the old matrix.
old - The matrix to canabalize.cols - The columns to copy.rows - The rows to copy.| Method Detail |
public java.lang.Object[][] getDataModel()
public int width()
width in interface DataMatrix2dpublic int height()
height in interface DataMatrix2dpublic int sizeWide()
getDataModel().length.
sizeWide in interface DataMatrix2dpublic int sizeHigh()
getDataModel()[0].length.
sizeHigh in interface DataMatrix2d
public java.lang.Object get(int column,
int row)
get in interface DataMatrix2dcolumn - The column (x position) of the cell to get.row - The row (y position) of the cell to get.
MatrixIndexOutOfBoundsException - if the index is
not within the boundaries of this matrix.
public java.lang.Object remove(int column,
int row)
remove in interface DataMatrix2dcolumn - The column (x position) of the cell to remove.row - The row (y position) of the cell to remove.
MatrixIndexOutOfBoundsException - if the index is
not within the boundaries of this matrix.
public void set(int column,
int row,
java.lang.Object data)
set in interface DataMatrix2dcolumn - The column (x position) of the cell to set.row - The row (y position) of the cell to set.data - The object to put into the specified cell.
MatrixIndexOutOfBoundsException - if the index is
not within the boundaries of this matrix.public MatrixIterator getMatrixIterator()
getMatrixIterator in interface DataMatrix2d
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||