public class ObjectTable extends java.lang.Object implements java.io.Serializable
Constructor and Description |
---|
ObjectTable()
Creates a new table.
|
ObjectTable(int increment)
Creates a new table.
|
ObjectTable(int rowIncrement,
int colIncrement)
Creates a new table.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the table.
|
protected void |
copyColumn(int oldColumn,
int newColumn)
Copys the contents of the old column to the new column.
|
protected void |
copyRow(int oldRow,
int newRow)
Copys the contents of the old row to the new row.
|
void |
ensureCapacity(int row,
int column)
Ensures that there is storage capacity for the specified item.
|
protected void |
ensureRowCapacity(int row)
Checks that there is storage capacity for the specified row and resizes
if necessary.
|
boolean |
equals(java.lang.Object o)
Tests this paint table for equality with another object (typically also
an
ObjectTable ). |
int |
getColumnCount()
Returns the number of columns in the table.
|
int |
getColumnIncrement()
Returns the column size increment.
|
protected java.lang.Object[][] |
getData()
Returns the table data.
|
protected java.lang.Object |
getObject(int row,
int column)
Returns the object from a particular cell in the table.
|
int |
getRowCount()
Returns the number of rows in the table.
|
int |
getRowIncrement()
Returns the row size increment.
|
int |
hashCode()
Returns a hash code value for the object.
|
protected java.lang.Object |
readSerializedData(java.io.ObjectInputStream stream)
Handles the deserialization of a single element of the table.
|
protected void |
setData(java.lang.Object[][] data,
int colCount)
Sets the table data.
|
protected void |
setObject(int row,
int column,
java.lang.Object object)
Sets the object for a cell in the table.
|
protected void |
writeSerializedData(java.io.ObjectOutputStream stream,
java.lang.Object o)
Handles the serialization of an single element of this table.
|
public ObjectTable()
public ObjectTable(int increment)
increment
- the row and column size increment.public ObjectTable(int rowIncrement, int colIncrement)
rowIncrement
- the row size increment.colIncrement
- the column size increment.public int getColumnIncrement()
public int getRowIncrement()
protected void ensureRowCapacity(int row)
row
- the row index.public void ensureCapacity(int row, int column)
row
- the row index.column
- the column index.public int getRowCount()
public int getColumnCount()
protected java.lang.Object getObject(int row, int column)
row
- the row index (zero-based).column
- the column index (zero-based).protected void setObject(int row, int column, java.lang.Object object)
row
- the row index (zero-based).column
- the column index (zero-based).object
- the object.public boolean equals(java.lang.Object o)
ObjectTable
).equals
in class java.lang.Object
o
- the other object.public int hashCode()
hashCode
in class java.lang.Object
protected void writeSerializedData(java.io.ObjectOutputStream stream, java.lang.Object o) throws java.io.IOException
stream
- the stream which should write the objecto
- the object that should be serializedjava.io.IOException
- if an IO error occuredprotected java.lang.Object readSerializedData(java.io.ObjectInputStream stream) throws java.lang.ClassNotFoundException, java.io.IOException
stream
- the object input stream from which to read the object.java.lang.ClassNotFoundException
- if a class cannot be found.java.io.IOException
- Any of the usual Input/Output related
exceptions.public void clear()
protected void copyColumn(int oldColumn, int newColumn)
oldColumn
- the index of the old (source) columnnewColumn
- the index of the new columnprotected void copyRow(int oldRow, int newRow)
oldRow
- the index of the old rownewRow
- the index of the new rowprotected void setData(java.lang.Object[][] data, int colCount)
data
- the data.colCount
- the number of columns.protected java.lang.Object[][] getData()