Class BitMatrix


  • public class BitMatrix
    extends Object
    A matrix object that is backed by a bitmap.
    Author:
    Andrea Antonello (www.hydrologis.com)
    • Constructor Detail

      • BitMatrix

        public BitMatrix​(int cols,
                         int rows)
    • 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:
        true if the bit is set, else false.
      • 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.