org.pentaho.reporting.libraries.fonts.tools
Class ByteTable

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

public class ByteTable
extends java.lang.Object
implements java.io.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:
Serialized Form

Constructor Summary
ByteTable(int rows, int cols)
          Creates a new table.
 
Method Summary
 void clear(byte value)
          Clears the table.
 void ensureCapacity(int row, int column)
          Ensures that there is storage capacity for the specified item.
 boolean equals(java.lang.Object o)
          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 getColumnCount()
          Returns the number of columns in the table.
protected  byte[][] getData()
           
 int getRowCount()
          Returns the number of rows in the table.
 int hashCode()
          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 Detail

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 Detail

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(java.lang.Object o)
Tests this paint table for equality with another object (typically also an ObjectTable).

Overrides:
equals in class java.lang.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 java.lang.Object
Returns:
the hashcode

clear

public void clear(byte value)
Clears the table.


getData

protected byte[][] getData()