com.google.zxing.qrcode.encoder

## Class ByteMatrix

- java.lang.Object
- - com.google.zxing.qrcode.encoder.ByteMatrix

-     public final class ByteMatrix
      extends Object

  JAVAPORT: The original code was a 2D array of ints, but since it only ever gets assigned -1, 0, and 1, I'm going to use less memory and go with bytes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteMatrix(int width, int height)` Creates a new ByteMatrix with the specified dimensions.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear(byte value)` Clears all cells in the matrix to the specified value.
    `byte` | `get(int x, int y)` Gets the value at the specified coordinates.
    `byte[][]` | `getArray()`
    `int` | `getHeight()`
    `int` | `getWidth()`
    `void` | `set(int x, int y, boolean value)` Sets the value at the specified coordinates using a boolean value.
    `void` | `set(int x, int y, byte value)` Sets the value at the specified coordinates.
    `void` | `set(int x, int y, int value)` Sets the value at the specified coordinates using an int value.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ByteMatrix

          public ByteMatrix(int width,
                            int height)

      Creates a new ByteMatrix with the specified dimensions.
      Parameters:
        `width` - the width of the matrix
        `height` - the height of the matrix

  - ### Method Detail

    - #### clear

          public void clear(byte value)

      Clears all cells in the matrix to the specified value.
      Parameters:
        `value` - the byte value to set all cells to

    - #### get

          public byte get(int x,
                          int y)

      Gets the value at the specified coordinates.
      Parameters:
        `x` - the x coordinate
        `y` - the y coordinate
      Returns:
        the byte value at the specified position

    - #### getArray

          public byte[][] getArray()

      Returns:
        an internal representation as bytes, in row-major order. array[y][x] represents point (x,y)

    - #### getHeight

          public int getHeight()

      Returns:
        the height of the matrix

    - #### getWidth

          public int getWidth()

      Returns:
        the width of the matrix

    - #### set

          public void set(int x,
                          int y,
                          boolean value)

      Sets the value at the specified coordinates using a boolean value.
      Parameters:
        `x` - the x coordinate
        `y` - the y coordinate
        `value` - the boolean value to set (true = 1, false = 0)

    - #### set

          public void set(int x,
                          int y,
                          byte value)

      Sets the value at the specified coordinates.
      Parameters:
        `x` - the x coordinate
        `y` - the y coordinate
        `value` - the byte value to set

    - #### set

          public void set(int x,
                          int y,
                          int value)

      Sets the value at the specified coordinates using an int value.
      Parameters:
        `x` - the x coordinate
        `y` - the y coordinate
        `value` - the int value to set (will be cast to byte)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`
      Returns:
        a string representation of this ByteMatrix