java.lang.Object
org.pentaho.reporting.libraries.fonts.tools.ByteTable
All Implemented Interfaces:
Serializable

public class ByteTable extends Object implements Serializable
A lookup table for objects. This implementation is not synchronized, it is up to the caller to synchronize it properly.
Author:
Thomas Morgner
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteTable(int rows, int cols)
    Creates a new table.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clear(byte value)
    Clears the table.
    void
    ensureCapacity(int row, int column)
    Ensures that there is storage capacity for the specified item.
    boolean
    Tests this paint table for equality with another object (typically also an ObjectTable).
    byte
    getByte(int row, int column, byte defaultValue)
    Returns the object from a particular cell in the table.
    int
    Returns the number of columns in the table.
    protected byte[][]
     
    int
    Returns the number of rows in the table.
    int
    Returns a hash code value for the object.
    void
    setByte(int row, int column, byte object)
    Sets the object for a cell in the table.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteTable

      public ByteTable(int rows, int cols)
      Creates a new table.
      Parameters:
      rows - the inital number of rows.
      cols - the initial number of columns.
  • Method Details

    • ensureCapacity

      public void ensureCapacity(int row, int column)
      Ensures that there is storage capacity for the specified item.
      Parameters:
      row - the row index.
      column - the column index.
    • getRowCount

      public int getRowCount()
      Returns the number of rows in the table.
      Returns:
      The row count.
    • getColumnCount

      public int getColumnCount()
      Returns the number of columns in the table.
      Returns:
      The column count.
    • getByte

      public byte getByte(int row, int column, byte defaultValue)
      Returns the object from a particular cell in the table. Returns null, if there is no object at the given position.

      Note: throws IndexOutOfBoundsException if row or column is negative.

      Parameters:
      row - the row index (zero-based).
      column - the column index (zero-based).
      Returns:
      The object.
    • setByte

      public void setByte(int row, int column, byte object)
      Sets the object for a cell in the table. The table is expanded if necessary.
      Parameters:
      row - the row index (zero-based).
      column - the column index (zero-based).
      object - the object.
    • equals

      public boolean equals(Object o)
      Tests this paint table for equality with another object (typically also an ObjectTable).
      Overrides:
      equals in class Object
      Parameters:
      o - the other object.
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Returns a hash code value for the object.
      Overrides:
      hashCode in class Object
      Returns:
      the hashcode
    • clear

      public void clear(byte value)
      Clears the table.
    • getData

      protected byte[][] getData()