|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.datamessenger.util.RecordSet
Provides a table for storing tabular data. The data is mapped to column and row coordinates. Table columns can be named for any unique Object value.
Copyright: Copyright (c) 2000 Jon L. Boynton
Company: Produx House, Corp
| Field Summary | |
protected java.util.Vector |
header
|
protected int |
length
|
protected int |
width
|
| Constructor Summary | |
RecordSet()
Creates an empty RecordSet. |
|
RecordSet(int width)
Creates a RecodSet with the specified number of columns. |
|
RecordSet(java.lang.Object[] fields)
Creates a RecodSet with a number of columns equal to the length of an Object array. |
|
RecordSet(java.util.Vector fields)
Creates a RecodSet with a number of columns equal to the size of a Vector. |
|
| Method Summary | |
void |
add(RecordSet records)
|
void |
addColumn(java.lang.Object name)
Adds a column to the right edge of the RecordsSet. |
java.lang.Object |
clone()
Creates a shallow copy of this RecordSet. |
void |
deleteColumnAt(int col)
Removes the column at the specified index. |
void |
deleteRowAt(int row)
Remove a row at the specified index. |
void |
fill(java.lang.Object[][] data,
int col,
int row,
int width)
Fills a range in the RecordSet with values from an Object[][]. |
void |
fill(java.lang.Object name,
java.lang.Object value,
FillConstraints c)
Adds a value to the next cell indicated by a constrains object. |
Record |
getColumn(int index)
Gets a copy of a column record by it's index value. |
Record |
getColumn(java.lang.Object name)
Gets a copy of the column record for the specified name. |
protected Record |
getColumnForName(java.lang.Object name)
Gets the actual Record Object for the specified name. |
int |
getColumnIndex(java.lang.Object name)
Finds the index for a column with the specified field name. |
int |
getColumnIndex(java.lang.Object name,
int fromIndex)
Finds the index for a column with the specified field name begining at the specified index. |
FillConstraints |
getFillConstraints()
Creates a default constaints Object for filling the rows of this RecordSet with new data. |
java.util.Vector |
getHeader()
Creates an ordered Vector containing the keys mapped to each Column. |
java.lang.Object |
getNameField()
Identifies a prefered field for naming a record. |
java.lang.Object[][] |
getRecord(int row)
Creates an 2D array containing the column name objects and the elements of a single row this RecordSet. |
java.lang.Object[][] |
getRecords()
Creates an 2D array containing all elements of this RecordSet. |
java.lang.Object[][] |
getRecords(int startx,
int starty,
int endx,
int endy)
Creates an 2D array containg the elements from a range of Records. |
RecordSet |
getRecordSetInstance()
Creates a new empty RecordSet with the same column fields. |
Record |
getRow(int index)
Creates a row record from an index value. |
java.lang.Object |
getValue(int col,
int row)
Finds the cell value in a column at a row index. |
java.lang.Object |
getValue(java.lang.Object col,
int row)
Finds the cell value in a column at a row index. |
java.util.Vector |
getValues()
|
int |
indexOf(java.lang.Object value,
java.lang.Object columnName)
Finds the row index of a value in a column with the specified name. |
int |
indexOf(java.lang.Object value,
java.lang.Object columnName,
int fromIndex)
Finds the row index of a value in a column with the specified name and starting index. |
void |
insertColumnAt(java.lang.Object name,
int col)
Inserts a new column at the specified index. |
void |
insertRowAt(int row)
Inserts a row at the specified index. |
int |
length()
The number of rows in the RecordSet. |
java.lang.Object |
lock()
|
Record |
lookUp(java.lang.Object value,
java.lang.Object name)
Finds a row record by looking up a value in the specified column. |
Record |
lookUp(java.lang.Object value,
java.lang.Object name,
int index)
Finds a row record by looking up a value in the specified column from the specified index. |
RecordSet |
lookUpAll(java.lang.Object value,
java.lang.Object name)
Finds all records with matching values in the specified column. |
void |
print()
|
void |
setLength(int length)
Sets the length of the RecordSet. |
void |
setNameField(java.lang.Object name)
Identifies a prefered field for naming a record. |
void |
setValue(java.lang.Object value,
int col,
int row)
Sets the cell value in a column at a row index. |
void |
setValue(java.lang.Object value,
java.lang.Object col,
int row)
Sets the cell value in a column at a row index. |
void |
setWidth(int width)
Sets the width of the RecordSet. |
int |
width()
The number of columns in the RecordSet. |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.util.Vector header
protected int length
protected int width
| Constructor Detail |
public RecordSet()
public RecordSet(int width)
width - the number of columns. This constructor defines the
column names by using the A-Z format common to spreadsheets.public RecordSet(java.util.Vector fields)
fields - the header field names.#getValue(Object, Object)public RecordSet(java.lang.Object[] fields)
fields - the header field names.| Method Detail |
public int getColumnIndex(java.lang.Object name)
name - the column name.
public int getColumnIndex(java.lang.Object name,
int fromIndex)
name - the column name.public Record getColumn(java.lang.Object name)
name - the column name.protected Record getColumnForName(java.lang.Object name)
name - the column name.public Record getColumn(int index)
the - column index starting at 0.public void addColumn(java.lang.Object name)
name - The column name Object
public void insertColumnAt(java.lang.Object name,
int col)
name - The column name Objectcol - the insert index.public void deleteColumnAt(int col)
col - the column index.public Record getRow(int index)
the - row index starting at 0.public void insertRowAt(int row)
col - the insert index.public void deleteRowAt(int row)
col - the insert index.
public Record lookUp(java.lang.Object value,
java.lang.Object name)
name - The name of the column being searched.value - the value being searched for.
public Record lookUp(java.lang.Object value,
java.lang.Object name,
int index)
name - The name of the column being searched.value - the value being searched for.index - the begining row index for the search (inclusive).
public RecordSet lookUpAll(java.lang.Object value,
java.lang.Object name)
name - The name of the column being searched.value - the value being searched for.public FillConstraints getFillConstraints()
FillConstraints
public void fill(java.lang.Object name,
java.lang.Object value,
FillConstraints c)
name - The next column name.value - the new cell valuec - a FillConstraints model.
public void fill(java.lang.Object[][] data,
int col,
int row,
int width)
data - a Object[][] containg new data.col - the left starting column index.row - the top starting row index.width - the number of columns to fill.public void add(RecordSet records)
public void setLength(int length)
length - the new lengthpublic void setWidth(int width)
width - the new width
public int indexOf(java.lang.Object value,
java.lang.Object columnName)
value - the value being searched for.columnName - The name of the column being searched.
public int indexOf(java.lang.Object value,
java.lang.Object columnName,
int fromIndex)
value - the value being searched for.columnName - The name of the column being searched.fromIndex - the begining index for the search.public java.lang.Object[][] getRecords()
public java.lang.Object[][] getRecords(int startx,
int starty,
int endx,
int endy)
startx - the starting column index (inclusive).starty - the starting row index (inclusive).endx - the ending column index (exclusive).endy - the ending row index (exclusive).public java.lang.Object[][] getRecord(int row)
obj[0][0] = a name object
obj[0][1] = a value object
public java.util.Vector getHeader()
public RecordSet getRecordSetInstance()
public java.lang.Object getValue(java.lang.Object col,
int row)
col - the column name.row - the row index.
public java.lang.Object getValue(int col,
int row)
col - the column index.row - the row index.public java.util.Vector getValues()
public void setValue(java.lang.Object value,
java.lang.Object col,
int row)
col - the column name.row - the row index.
public void setValue(java.lang.Object value,
int col,
int row)
col - the column name.row - the row index.public java.lang.Object getNameField()
public void setNameField(java.lang.Object name)
name - the field namepublic int width()
public int length()
public java.lang.Object clone()
public java.lang.Object lock()
public void print()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
| Comments, suggestions, and bug reports are welcomed and encouraged. Please refer them to our support page. Thank you. |
Copyright © 1999-2001 Produx House, Corp. All rights reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc.