|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbeowulf.model.Matrix
beowulf.model.IntegerMatrix
This class is an extension to the Matrix class. This IntegerMatrix contains
a two dimensional grid of java.lang.Integer objects. Some of
the methods have been overridden for casting convenience, and the default
value of an element of this matrix is a java.lang.Integer whose
value is that of the default integer value.
| Field Summary | |
protected int |
defaultIntegerValue
|
| Fields inherited from class beowulf.model.Matrix |
data, numCols, numRows |
| Constructor Summary | |
IntegerMatrix()
Creates a 1x1 IntegerMatrix with a default value of Integer.MAX_VALUE. |
|
IntegerMatrix(int size)
Creates a sizexsize IntegerMatrix with a
default value of Integer.MAX_VALUE. |
|
IntegerMatrix(int rows,
int cols)
Creates a rowsxcols IntegerMatrix with a
default value of Integer.MAX_VALUE. |
|
| Method Summary | |
void |
add(int row,
int col,
int value)
This method performs just as put(int, int, Object) but does
not fail when row or col are out of bounds. |
int |
getDefaultIntegerValue()
This will return the integer value of the default value used by this IntegerMatrix. |
Object |
getDefaultValue()
The new default value of the matrix is a java.lang.Integer
whose int value depends on the instance of the matrix. |
int |
getInt(int row,
int col)
This method returns the object at the specified position. |
void |
put(int row,
int col,
int value)
Sets the value at [ row][col] to be a
java.lang.Integer whose value is value. |
void |
setDefaultIntegerValue(int newValue)
This method will set the default integer value of this matrix. |
| Methods inherited from class beowulf.model.Matrix |
add, add, addAll, clear, contains, containsAll, expandBy, expandBy, expandTo, expandTo, get, getCols, getRows, isEmpty, iterator, put, remove, remove, remove, removeAll, removeCol, removeRow, retainAll, size, toArray, toArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
equals, hashCode |
| Field Detail |
protected int defaultIntegerValue
| Constructor Detail |
public IntegerMatrix()
Integer.MAX_VALUE.
public IntegerMatrix(int size)
sizexsize IntegerMatrix with a
default value of Integer.MAX_VALUE.
size - The size of the new matrix.
public IntegerMatrix(int rows,
int cols)
rowsxcols IntegerMatrix with a
default value of Integer.MAX_VALUE.
rows - The number of rows of the new matrix.cols - The number of columns of the new matrix.| Method Detail |
public int getDefaultIntegerValue()
Integer.MAX_VALUE.
public void setDefaultIntegerValue(int newValue)
newValue - The new default integer value.public Object getDefaultValue()
java.lang.Integer
whose int value depends on the instance of the matrix.
getDefaultValue in class Matrixjava.lang.Integer with an int value of
defaultIntegerValue.
public int getInt(int row,
int col)
row or col are out of bounds, an exception is
thrown. The return value is the result of calling
.intValue() on the java.lang.Integer in that
position. A ClassCastException could be thrown if an
object other than a java.lang.Integer was put into the
matrix.
row - The row index of the value.col - The column index of the value.
public void put(int row,
int col,
int value)
row][col] to be a
java.lang.Integer whose value is value. If
either row or col are out of bounds, and
exception will be thrown.
row - The row index of the value to set.col - The column index of the value to set.value - The new value of the indicated position.
public void add(int row,
int col,
int value)
put(int, int, Object) but does
not fail when row or col are out of bounds.
Rather, it will expand to the size implied by row and
col until the indicated location exists. The value at that
point will then be set.
row - The row index of the value to set.col - The column index of the value to set.value - The new value of the indicated position.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||