|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wisc.cs.util.BooleanMatrix
This class implements a two dimensional boolean matrix. It uses the
java.util.BitSet
object as it's underlying representation.
Field Summary | |
protected java.util.BitSet |
bits
The underlying representation of the values in this matrix. |
protected int |
ncols
The number of columns in the matrix. |
protected int |
nrows
The number of rows in the matrix. |
Constructor Summary | |
BooleanMatrix(int sqr)
Constrcts a square boolean matrix of the specified size. |
|
BooleanMatrix(int rows,
int cols)
Constructs a new boolean matrix of the specified size. |
Method Summary | |
boolean |
get(int r,
int c)
Queries the specified value in the matrix. |
int |
getNCols()
Returns the number of columns in this matrix. |
int |
getNRows()
Returns the number of rows in this matrix. |
void |
set(int r,
int c)
Sets the specified value in the matrix to the true state. |
void |
set(int r,
int c,
boolean value)
Sets a specified value in the matrix to the specified state. |
void |
unSet(int r,
int c)
Sets the specified value in the matrix to the false state. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.util.BitSet bits
protected final int nrows
protected final int ncols
Constructor Detail |
public BooleanMatrix(int sqr)
sqr
- the number of rows and columns in the new matrix.public BooleanMatrix(int rows, int cols)
rows
- the number of rows the new matrix.cols
- the number of cols the new matrix.Method Detail |
public int getNRows()
public int getNCols()
public void set(int r, int c, boolean value)
r
- the row position of the value to be set.c
- the column position of the value to be set.value
- the state to set at the specified position.public void set(int r, int c)
r
- the row position of the value to be set.c
- the column position of the value to be set.public void unSet(int r, int c)
r
- the row position of the value to be unset.c
- the column position of the value to be unset.public boolean get(int r, int c)
r
- the row position of the value to be queried.c
- the column position of the value to be queried.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |