org.pentaho.reporting.libraries.fonts.tools

Class ByteTable

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

Constructor Summary
ByteTable(int rows, int cols)
Creates a new table.
Method Summary
voidclear(byte value)
Clears the table.
voidensureCapacity(int row, int column)
Ensures that there is storage capacity for the specified item.
booleanequals(Object o)
Tests this paint table for equality with another object (typically also an ObjectTable).
bytegetByte(int row, int column, byte defaultValue)
Returns the object from a particular cell in the table.
intgetColumnCount()
Returns the number of columns in the table.
intgetRowCount()
Returns the number of rows in the table.
inthashCode()
Returns a hash code value for the object.
voidsetByte(int row, int column, byte object)
Sets the object for a cell in the table.

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

clear

public void clear(byte value)
Clears the table.

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.

equals

public boolean equals(Object o)
Tests this paint table for equality with another object (typically also an ObjectTable).

Parameters: o the other object.

Returns: A boolean.

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.

getColumnCount

public int getColumnCount()
Returns the number of columns in the table.

Returns: The column count.

getRowCount

public int getRowCount()
Returns the number of rows in the table.

Returns: The row count.

hashCode

public int hashCode()
Returns a hash code value for the object.

Returns: the hashcode

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.