|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectits.SQL.ContentsData
Representation of a database table or "rowset". Similar in usage and concept to a JDBC ResultSet, but with the handy addition of a movable cursor. Provides a common interface to data produced in several different contexts:
Contents.readTable(java.lang.String),
DataFactory.getExtractionHashtable(its.SQL.Schema, its.SQL.ContentsData, its.SQL.ContentsData),
Select#getResults,
ResultSet,
Serialized Form| Constructor Summary | |
ContentsData(byte[] blob)
|
|
ContentsData(Table table,
java.util.Vector data)
Constructs a ContentsData object. |
|
ContentsData(java.util.Vector vars,
java.util.Vector data)
Constructs a ContentsData object. |
|
| Method Summary | |
void |
append(ContentsData cd)
Appends a ContentsData Object to the end of the current one. |
void |
appendRowString(boolean commaSeparated,
boolean quoteStrings,
java.lang.StringBuffer sb)
|
static ContentsData |
createContentsDataFromBlob(byte[] data)
Static method for constructing a single blob ContentsData instance. |
java.lang.String |
edit(EditRow er)
Uses the given EditRow methods to construct a new string representation of this table, with any required changes as implemented by EditRow. |
void |
filter(AcceptRow ar)
Calls the given acceptRow method for each row in the object, and removes the row if the method returns false. |
java.lang.String |
getColumnNames()
Returns a string containing the column names in this table, separated by commas |
double |
getDouble(int ind)
|
double |
getDouble(java.lang.String name)
|
float |
getFloat(int ind)
|
float |
getFloat(java.lang.String name)
|
int |
getInt(int ind)
|
int |
getInt(java.lang.String name)
|
java.lang.Object |
getItem(int ind)
Gets the data from the specified column and the current row cursor |
java.lang.Object |
getItem(java.lang.String name)
Gets the data from the specified column and the current row cursor |
java.lang.Object |
getItem(Variable var)
Gets the data from the specified column and the current row cursor |
long |
getLong(int ind)
|
long |
getLong(java.lang.String name)
|
int |
getNumberOfColumns()
|
int |
getNumberOfRows()
|
java.lang.Object[] |
getRowArray()
Returns all data values on the current row, as an array of Objects. |
java.lang.Object[] |
getRowArray(int ind)
Returns all data values on the specified row, as an array of Objects. |
int |
getRowIndex()
|
java.lang.String |
getRowString()
Returns all data values on the current row, separated by spaces in a single string. |
java.lang.String |
getRowString(boolean commaSeparated,
boolean quoteStrings)
|
java.lang.String |
getRowString(int ind)
Returns all data values on the specified row, separated by spaces in a single string. |
short |
getShort(int ind)
|
short |
getShort(java.lang.String name)
|
java.lang.String |
getString(int ind)
|
java.lang.String |
getString(java.lang.String name)
|
Variable |
getVariable(java.lang.String name)
Gets the Variable object that describes the specified column |
java.util.Vector |
getVariables()
Gets a list of Variable objects that describe the columns in this rowset. |
boolean |
hasColumn(java.lang.String name)
|
java.util.Hashtable |
hashBy(int ind)
Allows easy filtering of a ContentsData object for a particular value in a particular column. |
java.util.Hashtable |
hashBy(java.lang.String name)
Allows easy filtering of a ContentsData object for a particular value in a particular column. |
java.util.Hashtable |
hashBy(Variable var)
Allows easy filtering of a ContentsData object for a particular value in a particular column. |
boolean |
isValid(java.lang.String name)
|
boolean |
next()
Increments the current row cursor index to its next value. |
void |
resetRowIndex()
Resets row cursor index to before the first row. |
void |
setRowIndex(int ind)
Sets the row cursor index to the specified value. |
java.lang.String |
toString(java.lang.String tableName)
An SDD operator can use this method to write the data contained in the ContentsData object to a string, in the SDD Contents language. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ContentsData(java.util.Vector vars,
java.util.Vector data)
vars - a list of Variables that specify the type of each data columndata - a list containing entries of type Object[], each of which
contains the values for a given row.
public ContentsData(Table table,
java.util.Vector data)
table - the Table object that defines the data types for each columndata - a list containing entries of type Object[], each of which
contains the values for a given row.public ContentsData(byte[] blob)
| Method Detail |
public static ContentsData createContentsDataFromBlob(byte[] data)
data - a byte[] array containing a single blob instancepublic boolean hasColumn(java.lang.String name)
name - the name of a column
public boolean next()
public Variable getVariable(java.lang.String name)
name - the column name
java.lang.IllegalArgumentException - thrown if name not validpublic java.util.Vector getVariables()
public java.lang.Object getItem(java.lang.String name)
name - the column namepublic java.lang.Object getItem(int ind)
ind - the column indexpublic java.lang.Object getItem(Variable var)
var - the column descriptorpublic double getDouble(int ind)
public double getDouble(java.lang.String name)
public float getFloat(int ind)
public float getFloat(java.lang.String name)
public int getInt(int ind)
public int getInt(java.lang.String name)
public long getLong(int ind)
public long getLong(java.lang.String name)
public short getShort(int ind)
public short getShort(java.lang.String name)
public java.lang.String getString(int ind)
public java.lang.String getString(java.lang.String name)
public java.util.Hashtable hashBy(Variable var)
var - the Variable object describing a column
public java.util.Hashtable hashBy(java.lang.String name)
name - the column name
public java.util.Hashtable hashBy(int ind)
ind - the column index
public boolean isValid(java.lang.String name)
public int getNumberOfColumns()
public int getNumberOfRows()
public int getRowIndex()
public void setRowIndex(int ind)
ind - desired index valuepublic void resetRowIndex()
public java.lang.String getColumnNames()
public java.lang.String getRowString()
public java.lang.String getRowString(boolean commaSeparated,
boolean quoteStrings)
public void appendRowString(boolean commaSeparated,
boolean quoteStrings,
java.lang.StringBuffer sb)
public java.lang.String getRowString(int ind)
ind - index
java.lang.IllegalArgumentExceptionpublic java.lang.Object[] getRowArray()
public java.lang.Object[] getRowArray(int ind)
ind - index
public void append(ContentsData cd)
cd - the ContentsData object to be addedpublic void filter(AcceptRow ar)
public java.lang.String edit(EditRow er)
public java.lang.String toString(java.lang.String tableName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||