Package org.hortonmachine.gears.utils
Class BitMatrix
- java.lang.Object
-
- org.hortonmachine.gears.utils.BitMatrix
-
public class BitMatrix extends Object
A matrix object that is backed by a bitmap.- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Constructor Summary
Constructors Constructor Description BitMatrix(int cols, int rows)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisMarked(int col, int row)Gets the state of a particular bit.voidmark(int col, int row)Marks the bit in a given position.StringtoString()voidunMark(int col, int row)Unmarks the bit in a given position.
-
-
-
Method Detail
-
isMarked
public boolean isMarked(int col, int row)Gets the state of a particular bit.- Parameters:
col- the col in the matrix of the bit.row- the row in the matrix of the bit.- Returns:
trueif the bit is set, elsefalse.
-
mark
public void mark(int col, int row)Marks the bit in a given position.- Parameters:
col- the col position to mark.row- the row position to mark.
-
unMark
public void unMark(int col, int row)Unmarks the bit in a given position.- Parameters:
col- the col position to mark.row- the row position to mark.
-
-