|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--planetj.database.RowCollection
Represents a group of rows from the database. Usually a RowCollection is created as a result of a database query.
Nested Class Summary | |
static class |
RowCollection.LinkedRowCollection
A subclass of RowCollection which uses a LinkedList internally instead of an ArrayList. |
Field Summary | |
static String |
className
|
static int |
FIRST_ROW
Pass FIRST_ROW to the addRows() method to have the first row in a RowCollection be the first row in the ResultSet |
static int |
LAST_ROW
Pass LAST_ROW to the addRows() method to have the last row in a RowCollection be the last row in the ResultSet |
Constructor Summary | |
RowCollection()
Creates a new RowCollection |
|
RowCollection(Table table)
Creates a new RowCollection for a specific table. |
|
RowCollection(Table table,
List fieldNames)
Creates a new RowCollection containing the given fields for a specific table. |
Method Summary | |
void |
add(int index,
Object row)
Inserts the specified row at the specified position in this list (optional operation). |
boolean |
add(Object row)
Appends the specified row to the end of this list. |
boolean |
addAll(Collection rows)
Appends the rows in the collection to this RowCollection |
boolean |
addAll(int index,
Collection rows)
Inserts all of the rows in the specified collection into this RowCollection at the specified position (optional operation). |
int |
addFDRows(ResultSet pRS)
|
void |
addRow(int index,
Row row)
Inserts the specified row at the specified position in this list (optional operation). |
boolean |
addRow(Row row)
Appends the specified row to the end of this list. |
void |
addRowEventListener(IRowEventListener pNewListener)
Adds a new Listener to this Row. |
int |
addRows(int pFirstRow,
int pRowCount,
ResultSet pRS)
Adds rows from the results set to this RowCollection. |
void |
addTable(Table table)
Adds a Table to the list of Table to which this RowCollection corresponds. |
void |
batchProcess()
Process this Object. |
void |
clear()
Removes all the rows from this RowCollection |
void |
clearRows()
Removes all the Rows from this RowCollection. |
void |
clearTables()
Removes the tables associated with this row collection Creation date: (1/22/2002 5:59:14 PM) |
Object |
clone()
Clone this RowCollection object. |
RowCollection |
cloneRowCollection()
Untested method. |
boolean |
contains(Object row)
Tests if a Row is contained in this RowCollection |
boolean |
contains(Row row)
Tests if a Row is contained in this RowCollection |
boolean |
containsAll(Collection rows)
Tests if a group of rows are contained in this RowCollection |
boolean |
containsRowWithFieldsEqualTo(Row pRow,
List pFieldNamesToCompare)
Tests if this RowCollection has a row with field values equal to the row passed in but only comparing the supplied fields. |
String |
copyToConnection(SQLContext context)
Copies the RowCollection to the specified SQLContext. |
String |
copyToConnection(String outputAlias)
Copies the RowCollection to the specified Connection Alias. |
String |
copyToConnection(String outputAlias,
String libraryName,
String tableName)
Copies the RowCollection to the specified Connection Alias. |
FieldDescriptorRow |
createFieldDescriptor(int columnIndex,
ResultSetMetaData pRSMetaData)
Creates a FieldDescriptor for the information at the specified index using the ResultSetMetaData. |
static RowCollection |
createRowCollection(SQLContext context)
Creates a new RowCollection object based on the information in a SQLContext. |
int |
delete()
Deletes all the rows in this RowCollection from the database. |
int |
delete(Connection conn)
Deletes all the rows in this RowCollection from the database. |
int |
delete(Connection conn,
ExecutingContext ec)
Deletes all the rows in this RowCollection from the database. |
int |
delete(ExecutingContext ec)
Deletes all the rows in this RowCollection from the database. |
boolean |
doesFieldDescriptorExist(String pFieldName,
boolean pCheckFieldDataFile)
Checks to see if a FieldDescriptor exists for the given Field name. |
void |
executeDistributedAction()
Insert the method's description here. |
FilteredRowCollection |
filter(IFilter filter)
Returns a FilteredRowCollection
that contains only rows which match the filter criteria. |
FilteredRowCollection |
filter(IFilter filter,
boolean connected)
Returns a RowCollection of the that contains
only rows which match the filter criteria. |
RowCollection |
filter(String fieldName,
int comparison,
Object obj)
Return a RowCollection that matches the filter criteria. |
Row |
firstRow()
Gets the first Row, return null if no rows exists. |
Object |
get(int index)
Gets the row at the specified index |
Object |
getAttribute(Object key)
Get an attribute about the RowCollection for the given key. |
int |
getColumnCount()
Returns the number of columns in each of the rows in this RowCollection. |
List |
getColumnValues(int columnNumber)
Gets all the values of a single column in this RowCollection. |
List |
getColumnValues(String columnName)
Gets all the values of a single column in this RowCollection. |
List |
getColumnValuesByUsageId(int usageId)
Gets all the values of a single column in this RowCollection. |
RowCollection |
getCompleteRowCollection()
Gets a RowCollection containing Rows having all Fields using the same search criteria as this RowCollection. |
RowCollection |
getCompleteRowCollection(Connection pConnection)
Gets a RowCollection containing Rows having all Fields using the same search criteria as this RowCollection. |
Object |
getConfigProperty(String key,
ExecutingContext executingContext)
Get a config property for the given row. |
Collection |
getConnectedChildren()
Gets the child RowCollections which are connected to this one. |
Class |
getContainedClass()
Gets the type of Row (or subclass of Row) contained in this RowCollection |
URL |
getDistributedRequestorURL()
Insert the method's description here. |
long |
getEstimatedSize()
Gets the estimated number of bytes of all field values in this RowCollection take up. |
String |
getExternalName(String fieldName)
Gets the external name of a field |
List |
getExternalNames()
Gets the external names of this RowCollection's fields |
List |
getExternalNames(List fieldNames)
Gets the external names of the specified fields of this RowCollection |
StringBuffer |
getFDFData(StringBuffer pFDFData)
This returns a StringBuffer containing all necessary FDF data for this object. |
int |
getFieldCount()
Gets the number of Fields each Row has in this RowCollection. |
FieldDescriptorRow |
getFieldDescriptor(String pFieldName)
Returns the field descriptor associated with the given field name. |
FieldDescriptorCollection |
getFieldDescriptorCollection()
Deprecated. This method returns all field descriptors in the table, including those which are not in this RowCollection. In addition, only field descriptors in the first table are returned. |
FieldDescriptorCollection |
getFieldDescriptorCollection(Table pTable)
Deprecated. Use Table.getFieldDescriptorCollection() instead |
List |
getFieldDescriptors()
Gets a List containing the field descriptors used for this RowCollection |
List |
getFieldDescriptorsWithUsage()
Get a Collection of FieldDescriptorRows for this Row that have a UsageId defined for them. |
List |
getFieldDescriptorsWithUsageId(int usageId)
Get a Collection of FieldDescriptorRows for this Row that have the given UsageId defined for them. |
FieldDescriptorRow |
getFieldDescriptorWithUsageId(int usageId)
Get a FieldDescriptorRow for this Row that have the given usage id defined for them. |
List |
getFieldNames()
Returns a List of names of the Fields in each Row. |
List |
getFieldNameSets()
Gets a List of FieldSets, containing the *NAMES* of fields in that field set. |
List |
getFields(String columnName)
Gets all the Fields of a single column in this RowCollection. |
List |
getFieldsToDisplay()
Return a List of all the Field names that will be displayed by default. |
List |
getFieldsToDisplayStrict(ExecutingContext pEc)
Return a List of all the Field names that will be displayed by default. |
List |
getFieldsToDisplayStrict(List fieldNames,
ExecutingContext pEc)
Return a List of all the Field names that will be displayed by default. |
List |
getGraphableFieldNames()
Inspects this RowCollection to determine which of its Fields are graphable. |
List |
getJoinFieldNames()
Gets the names of fields to join on. |
long |
getLastUpdated()
Gets the time when this RowCollection was last updated. |
String |
getLibraryName()
|
String |
getMetaDataSystemAlias()
Returns the meta data alias of the system to which this RowCollection belongs |
String |
getNavigationKey()
Get the key used to store/retrieve this RowCollection to/from navigation. |
String |
getNavigationListKey()
Get the key used to store and retrieve a List of RowCollections that have been put into navigation. |
RowCollection |
getNextRowCollection()
Gets a RowCollection containing another group of rows which satisfy the query that was used to create this RowCollection. |
RowCollection |
getNextRowCollection(int pNumberOfRows)
Gets a RowCollection containing another group of rows which satisfy the query that was used to create this RowCollection. |
RowCollection |
getPreviousRowCollection()
Gets a RowCollection containing another group of rows which satisfy the query that was used to create this RowCollection. |
RowCollection |
getPreviousRowCollection(int pNumberOfRows)
WK (4/24/2002 9:16:11 AM): Need to reword javadoc, first row is now the number of records per page before the previous row - fixes bug when last row collection doesn't contain the complete number of pages Gets a RowCollection containing another group of rows which satisfy the query that was used to create this RowCollection. |
PropertyGroup |
getPropertyGroup(String groupName)
Gets the first PropertyGroup with the given property group name. |
PropertyGroupList |
getPropertyGroups()
Get all the property groups stored in this RowCollection's attributes. |
List |
getPropertyGroups(String groupName)
Get this RowCollection's property groups with the given group name. |
ResultSet |
getResultSet()
Returns the result set that was set within this row collection. |
int |
getRetrievedRowCount()
Gets the total number of database rows that have been added to this RowCollection as a result of a database query. |
Row |
getRow(int i)
Gets the Row with the specified index out of this RowCollection. |
int |
getRowCount()
Returns the number of Rows in this RowCollection. |
List |
getRows()
Returns a List of Rows contained within this RowCollection. |
List |
getSortedColumnNames()
Get the names of columns that have been sorted on. |
boolean |
getSortedColumnNamesAscending()
Return true is the columns sorted on where in ascending order. |
String |
getSQL()
Gets the SQL statement which was used to create this RowCollection. |
SQLContext |
getSQLContext()
Gets the SQL context that was used to create this RowCollection. |
double |
getSum(String fieldName)
Returns a double which is the sum of the rows for the requested column value. |
String |
getSystemAlias()
Gets the alias to the system to connect to |
Table |
getTable()
Gets the table object for this RowCollection. |
String |
getTableName()
|
TableCollection |
getTables()
|
long |
getTimestamp()
Gets the time when this RowCollection was created. |
String |
getTitle()
Gets the title of this RowCollection |
ValidationExceptionCollection |
getValidationExceptions()
Be careful when you call this method because it is derived and spins through all the fields of all the Rows in this RowCollection. |
double |
getValueAsDouble(int rowIndex,
int fieldIndex)
|
double |
getValueAsDouble(int rowIndex,
String fieldName)
|
StringBuffer |
getXMLData(StringBuffer pXMLData)
Deprecated. Use the method which takes a XMLDescriptor as a parameter |
StringBuffer |
getXMLData(XMLFileDescriptor pDescriptor,
StringBuffer pXMLData)
This returns a StringBuffer containing all necessary XML data for this object. |
StringBuffer |
getXMLHeaderData(StringBuffer pXMLData)
This returns a StringBuffer containing all XMLHeader data for this RowCollection. |
StringBuffer |
getXMLHeaderData(XMLFileDescriptor pDescriptor,
StringBuffer pXMLData)
This returns a StringBuffer containing all XMLHeader data for this RowCollection. |
void |
handleDistributed(String pActionName)
Set the method that will be called after Row is deserialized on the target. |
boolean |
hasConnectedChildren()
Tests if this RowCollection has connected children |
boolean |
hasNextRowCollection()
Checks if there were additional rows available in the last ResultSet that was used to populate this RowCollection that were not added to this RowCollection. |
boolean |
hasPreviousRowCollection()
Checks if there were previous rows available in the last ResultSet that was used to populate this RowCollection that were not added to this RowCollection. |
int |
indexOf(Object pRow)
Returns the index in this list of the first occurrence of the specified row, or -1 if this list does not contain this row. |
int |
indexOf(String fieldName)
Returns the index of the first occurrence of the specified field name, or -1 if the field is not contained in this RowCollection's Rows. |
int |
insert()
Inserts all the rows in this RowCollection into the database. |
int |
insert(Connection conn)
Inserts all the rows in this RowCollection into the database. |
int |
insert(ExecutingContext ec)
Inserts all the rows in this RowCollection into the database. |
int |
insert(SQLContext context)
Inserts all the rows in this RowCollection into the database. |
int |
insertBatch()
Inserts all the Rows in this RowCollection into the database in a single batch. |
boolean |
isARow()
Return a boolean indicating if this object is a Row |
boolean |
isARowCollection()
Return a boolean indicating if this object is a RowCollection |
boolean |
isCloneNeeded()
Test to see if tiis navigation object should be clone upon storing and retrieving. |
boolean |
isCurrent()
Tests if none of the tables whose data is contained in this RowCollection have been updated via DataEngine since this RowCollection was read from the database. |
boolean |
isEmpty()
Returns whether or not this RowCollection is empty. |
boolean |
isFromCache()
Return whether or not this RowCollection was returned from Cache |
boolean |
isFromGroupBy()
Return whether or not this Row was created with a group by in the SQL clause. |
boolean |
isFromJoin()
Return whether or not this Row was created from a join. |
boolean |
isGraphable()
Checks to see if this RowCollection could possibly be charted or graphed. |
boolean |
isHasColumnNames(List columns)
Checks to see if this RowCollection has all the columns in the given List. |
boolean |
isHasRowEventListners()
|
boolean |
isLocked()
Tests if this RowCollection is locked. |
boolean |
isOkToReturnMeFromCache(SQLContext pSQLContext)
Return a boolean indicating if it is ok to return this RowCollection for the specified SQLContext. |
boolean |
isRowCollectionContainEditableRow(ExecutingContext ec)
Check to see if this RowCollection contains an editable Row. |
boolean |
isValidateRequired()
Tests if this Row must be validated before it is inserted/updated |
Iterator |
iterator()
Returns an iterator which iterates through the Rows of this RowCollection |
int |
lastIndexOf(Object row)
Returns the index in this list of the last occurrence of the specified row, or -1 if this list does not contain this row. |
ListIterator |
listIterator()
Deprecated. Avoid calling this method if possible - row removal isn't supported correctly |
ListIterator |
listIterator(int index)
Deprecated. Avoid calling this method if possible - row removal isn't supported correctly |
Row |
newRow()
Creates, adds, and returns a new Row from this RowCollection. |
Row |
newRow(int index)
Creates, adds, and returns a new Row from this RowCollection. |
RowCollection |
prepareForDisplay(ExecutingContext ec)
This method is intended for subclass to override and provide their own functionality. |
RowCollection |
prepareForResults(ExecutingContext pEc)
Gets the a proper RowCollection for viewing this RowCollections results. |
RowCollection |
prepareForReturnFromCache(ExecutingContext ec)
This method is intended for subclasses to override and provide their own functionality if needed. |
RowCollection |
prepareFromFieldNames(List pNames)
Gets the a proper RowCollection for viewing this RowCollections results. |
void |
reconcile()
Reconciles the database, using all the rows in this RowCollection and checking to see if there are concurrent updates. |
void |
reconcile(Connection conn)
Reconciles the database, using all the rows in this RowCollection and checking to see if there are concurrent updates. |
RowCollection |
refresh()
This method will refresh this RowCollection from the database and return this. |
RowCollection |
refreshIfNeeded()
Refreshes this RowCollection from the database, but only if one or more of the tables whose data is contained in this RowCollection has been updated with the DataEngine since this RowCollection was last read from the database. |
Object |
remove(int i)
Removes the row with the specified index from this RowCollection. |
boolean |
remove(Object row)
Removes the row from this RowCollection. |
boolean |
removeAll(Collection rows)
Removes all the Rows contained in the Collection from this RowCollection. |
boolean |
removeAllRows()
Removes all the rows in this RowCollection |
Object |
removeAttribute(Object key)
Remove an attribute about the RowCollection for the given key. |
void |
removeNavigationKey()
Clears out any navigation key that may have been set on this RowCollection. |
Row |
removeRow(int i)
Removes the row with the specified index from this RowCollection (the first row has an index of 0). |
boolean |
removeRow(Row row)
Removes the row from this RowCollection. |
boolean |
removeRow(Row row,
List fieldNames)
Removes the row from this RowCollection. |
boolean |
removeRowBasedOnKeyValues(Row row)
Removes the row from this RowCollection. |
void |
removeRowEventListener(IRowEventListener pNewListener)
Removes a Listener from this Row |
void |
removeTable(Table table)
Removes a Table to the list of Table to which this RowCollection corresponds. |
void |
replaceRow(Row oldRow,
Row newRow)
Replaces one Row in this RowCollection with another Row. |
boolean |
retainAll(Collection rows)
Retains only the elements in this collection that are contained in the specified collection. |
RowCollection |
rollbackChanges()
Undoes any changes that have been made to this RowCollection since it was read from or written to the database. |
boolean |
rowAltered(SQLContext context,
ExecutingContext ec)
This method is invoked when this RowCollection is in the cache, and a single row is deleted, inserted, or updated. |
Object |
set(int index,
Object row)
Replaces the row at the specified position in this list with the specified row (optional operation). |
void |
setAttribute(Object key,
Object value)
Set the given attribute about the RowCollection for the given key. |
void |
setColumnValues(String columnName,
Object value)
Sets all the row values of a single column in this RowCollection. |
void |
setContainedClass(Class containedClass)
Sets the type of Row (or subclass of Row) contained in this RowCollection |
void |
setDistributed(boolean pDistributed)
Should be set to true if serialized and distributed for web services. |
void |
setDistributedRequestorURL(URL pSource)
Insert the method's description here. |
void |
setDistributedSourceURL()
Insert the method's description here. |
void |
setDistributedTargetURL(URL pTarget)
Insert the method's description here. |
void |
setLastUpdated(long ts)
Sets the last time this RowCollection was updated |
void |
setNavigationKey(String key)
Set the key used to store/retrieve this RowCollection to/from navigation. |
void |
setPropertyGroups(PropertyGroupList propertyGroups)
Set the property groups stored in this RowCollection's attributes. |
void |
setResultSet(ResultSet pResultSet)
Sets the result set on the row collection. |
Row |
setRow(int index,
Row row)
Replaces the row at the specified position in this list with the specified row (optional operation). |
void |
setSortedColumnNames(String[] sortedColumnNames,
boolean sortedAscending)
Set the names of columns that have been sorted on. |
void |
setSql(String newSql)
Sets the SQL string used to create this RowCollection. |
void |
setSystemAlias(String pAlias)
Sets the alias of the system containing the database where this RowCollection's rows are stored. |
void |
setTable(Table pTable)
Sets the table that is associated with this row collection Creation date: (1/22/2002 5:59:14 PM) |
void |
setTables(List pTables)
Deprecated. Pass in a TableCollection instead |
void |
setTables(TableCollection pTables)
Sets the tables associated with this row collection Creation date: (1/22/2002 5:59:14 PM) |
int |
size()
Returns the number of Rows in this RowCollection. |
RowCollection |
sort(String[] pColumnNames,
String pSortOrder)
Sorts the Rows in this RowCollection. If this RowCollection contains all rows from its database table, then we can do an internal sort. |
void |
sortInternal(String[] pColumnNames,
String pSortOrder)
If this RowCollection contains all rows from its database table, then we can do an internal sort. |
List |
subList(int startIndex,
int endIndex)
Returns a view of this RowCollection. |
Object[] |
toArray()
Returns the Row objects contained in this RowCollection in an array, as described by the Collection.toArray() method. |
Object[] |
toArray(Object[] array)
Returns the Row objects contained in this RowCollection in an array, as described by the Collection.toArray() method. |
StringBuffer |
toCSV(boolean pIncludeColumnHeadings,
CSVFileDescriptor pCSVFileDescriptor)
Deprecated. |
StringBuffer |
toCSV(CSVFileDescriptor pCSVFileDescriptor)
Returns a StringBuffer in CSV format containing all data in this RowCollection. |
StringBuffer |
toDOC(boolean pIncludeColumnHeadings,
CSVFileDescriptor pFileDescriptor)
Deprecated. |
StringBuffer |
toDOC(CSVFileDescriptor pFileDescriptor)
Returns a StringBuffer in Microsoft Word .doc format containing all data in this RowCollection. |
StringBuffer |
toFDF(FDFFileDescriptor pFileDescriptor)
Returns a StringBuffer in FDF format containing all data in this RowCollection. |
void |
toPDF(PDFFileDescriptor pFileDescriptor)
Generates a PDF file from this RowCollection. |
String |
toString()
Returns a String representation of this RowCollection. |
void |
toUpperCase()
This method will UPPERCASE all the fields values in this RowCollections Rows Fields if it is stored in the databse as a Char or it is a StringField. |
StringBuffer |
toXML(XMLFileDescriptor pFileDescriptor)
Returns a StringBuffer in XML format containing all data in this RowCollection. |
int |
update()
Updates the database, using all the rows in this RowCollection. |
int |
update(Connection connection)
Updates all the Rows in this RowCollection in the database. |
int |
update(Connection connection,
ExecutingContext ec)
Updates the database, using all the rows in this RowCollection. |
int |
update(ExecutingContext ec)
Updates this RowCollection's Rows in the database |
boolean |
validate(ExecutingContext context)
Validate this RowCollection's Rows based on their configuration and Field values. |
boolean |
validate(ExecutingContext pContext,
Principal pUser)
Deprecated. by WK on (8/9/2003 9:24:24 AM) because the executing context contains the user. Replaced with validate(ExecutingContext). This method will no longer be supported as of WOW 7.0. |
boolean |
validate(int pOperation,
Principal pUser)
Deprecated. Use the validate method which takes in a ExecutingContext |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
equals, hashCode |
Field Detail |
public static final int FIRST_ROW
public static final int LAST_ROW
public static final String className
Constructor Detail |
public RowCollection()
public RowCollection(Table table) throws CMException
table
- The table associated with this RowCollectionpublic RowCollection(Table table, List fieldNames) throws CMException
table
- The table associated with this RowCollectionfieldNames
- A List containing the names of the fields that will be in this RowCollectionMethod Detail |
public void add(int index, Object row)
add
in interface List
index
- index at which the specified row is to be inserted.row
- the row to be inserted.
UnsupportedOperationException
- if the add method is not
supported by this list.
ClassCastException
- if the class of the specified row
prevents it from being added to this list.
IllegalArgumentException
- if some aspect of the specified
row prevents it from being added to this list.
IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index > size()).public boolean add(Object row)
add
in interface List
row
- The row (which must be an instance of planetj.database.Row
) to append
public boolean addAll(int index, Collection rows)
This implementation gets an iterator over the specified collection and iterates over it, inserting the rows obtained from the iterator into this list at the appropriate position, one at a time, using add(int, Object). Many implementations will override this method for efficiency.
Note that this implementation throws an UnsupportedOperationException unless add(int, Object) is overridden.
addAll
in interface List
index
- index at which to insert the first row from the
specified collection.
UnsupportedOperationException
- if the addAll method is
not supported by this list.
ClassCastException
- if the class of an row of the specified
collection prevents it from being added to this List.
IllegalArgumentException
- some aspect an row of the
specified collection prevents it from being added to this
List.
IndexOutOfBoundsException
- index out of range (index < 0
|| index > size()).public boolean addAll(Collection rows)
addAll
in interface List
rows
- A Collection, all of whose objects must either be Row objects, or subclasses of Row.
public int addFDRows(ResultSet pRS) throws CMException
CMException
public void addRow(int index, Row row)
index
- index at which the specified row is to be inserted.row
- the row to be inserted
UnsupportedOperationException
- if the add method is not
supported by this list.
ClassCastException
- if the class of the specified row
prevents it from being added to this list.
IllegalArgumentException
- if some aspect of the specified
row prevents it from being added to this list.
IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index > size()).public boolean addRow(Row row)
row
- The row (which must be an instance of planetj.database.Row
) to append
public void addRowEventListener(IRowEventListener pNewListener)
public int addRows(int pFirstRow, int pRowCount, ResultSet pRS) throws CMException
pFirstRow
- The row from the result set which will become row 1 of this RowCollection. The first
row in the result is row number 1. There are two special constants that can be used for this argument:
FIRST_ROW, and LAST_ROW. To add the first ten rows in the result set to this RowCollection you
could invoke this method like this:
addRows (RowCollection.FIRST_ROW, 10, resultSet);
addRows (RowCollection.LAST_ROW - 10, 10, resultSet);
pRowCount
- The number of row from the ResultSet to try and add to this RowCollection. If the special constant
SQLContext.NO_MAXIMUM is passed as this argument, then all the rows in the ResultSet (that aren't before the
row indicated by the pFirstRow parameter) will be added to this RowCollection.pRS
- The result set from which rows will be added.
CMException
public void addTable(Table table)
public void batchProcess()
batchProcess
in interface IBatchProcessObject
public void clear()
clear
in interface List
public void clearRows()
public void clearTables()
public Object clone()
clone
in interface INavigationObject
clone
in class Object
public RowCollection cloneRowCollection() throws CMException
CMException
public boolean contains(Object row)
contains
in interface List
row
- A Row (or subclass of Row) which may or may not be contained in this RowCollection
public boolean contains(Row row)
row
- A Row which may or may not be contained in this RowCollection
public boolean containsAll(Collection rows)
containsAll
in interface List
rows
- A Collection containing only Row objects, or objects which are subclasses of Row
public boolean containsRowWithFieldsEqualTo(Row pRow, List pFieldNamesToCompare)
public String copyToConnection(String outputAlias) throws CMException
CMException
public String copyToConnection(String outputAlias, String libraryName, String tableName) throws CMException
CMException
public String copyToConnection(SQLContext context) throws CMException
CMException
public FieldDescriptorRow createFieldDescriptor(int columnIndex, ResultSetMetaData pRSMetaData) throws CMException
pRSMetaData
- ResultSetMetaData containing the information
for creating the FieldDescriptor.
CMException
public static RowCollection createRowCollection(SQLContext context) throws DataEngineException
DataEngineException
public final int delete() throws CMException
CMException
public final int delete(Connection conn) throws CMException, DistributedException
CMException
DistributedException
public int delete(Connection conn, ExecutingContext ec) throws CMException, DistributedException
CMException
DistributedException
public final int delete(ExecutingContext ec) throws CMException
CMException
public boolean doesFieldDescriptorExist(String pFieldName, boolean pCheckFieldDataFile) throws CMException
pFieldName
- Name of the Field to see if a FieldDescriptor exists
for that Field.pCheckFieldDataFile
- Flag to indicate whether or not to check the
the Field data file for a FieldDescriptor.
CMException
public void executeDistributedAction() throws DistributedException
executeDistributedAction
in interface IDistributedExecutableObject
DistributedException
public RowCollection filter(String fieldName, int comparison, Object obj) throws CMException
CMException
public FilteredRowCollection filter(IFilter filter) throws DataEngineException
FilteredRowCollection
that contains only rows which match the filter criteria. The returned RowCollection is
connected
to this RowCollection.
filter
- The filter which will be used to examine each row
DataEngineException
public FilteredRowCollection filter(IFilter filter, boolean connected) throws DataEngineException
RowCollection
of the that contains
only rows which match the filter criteria.
filter
- The filter which will be used to examine each rowconnected
- Whether or not the returned FilteredRowCollection should be connected to this RowCollection
DataEngineException
public Row firstRow()
public Object get(int index)
get
in interface List
public Object getAttribute(Object key)
public int getColumnCount() throws CMException
CMException
public List getColumnValues(int columnNumber)
public List getColumnValues(String columnName)
public List getColumnValuesByUsageId(int usageId) throws CMException
CMException
public RowCollection getCompleteRowCollection() throws CMException
If this RowCollection already contains Rows having all Fields, then return itself. NOTE: WK (4/12/2002 4:42:23 PM) this method would not work for joins
CMException
public RowCollection getCompleteRowCollection(Connection pConnection) throws CMException
If this RowCollection already contains Rows having all Fields, then return itself. NOTE: WK (4/12/2002 4:42:23 PM) this method would not work for joins
CMException
public final Object getConfigProperty(String key, ExecutingContext executingContext)
public Collection getConnectedChildren()
public Class getContainedClass()
public URL getDistributedRequestorURL()
public long getEstimatedSize()
public String getExternalName(String fieldName) throws CMException
CMException
public List getExternalNames() throws CMException
CMException
public List getExternalNames(List fieldNames) throws CMException
CMException
public StringBuffer getFDFData(StringBuffer pFDFData)
getFDFData
in interface IFDFObject
public int getFieldCount()
public FieldDescriptorRow getFieldDescriptor(String pFieldName) throws CMException
pFieldName
- String
CMException
public FieldDescriptorCollection getFieldDescriptorCollection() throws CMException
CMException
public FieldDescriptorCollection getFieldDescriptorCollection(Table pTable) throws CMException
CMException
public List getFieldDescriptors() throws CMException
CMException
public List getFieldDescriptorsWithUsage() throws CMException
CMException
public List getFieldDescriptorsWithUsageId(int usageId) throws CMException
CMException
public FieldDescriptorRow getFieldDescriptorWithUsageId(int usageId) throws CMException
CMException
public List getFieldNames()
public List getFieldNameSets() throws CMException
CMException
public List getFields(String columnName)
public List getFieldsToDisplay()
public List getFieldsToDisplayStrict(List fieldNames, ExecutingContext pEc)
public List getFieldsToDisplayStrict(ExecutingContext pEc)
public List getGraphableFieldNames() throws CMException
CMException
public List getJoinFieldNames()
public long getLastUpdated()
public String getLibraryName()
public String getMetaDataSystemAlias()
public String getNavigationKey()
getNavigationKey
in interface INavigationObject
public String getNavigationListKey()
getNavigationListKey
in interface INavigationObject
public RowCollection getNextRowCollection() throws CMException
hasNextRowCollection()
method can be used to test
for this case.
CMException
public RowCollection getNextRowCollection(int pNumberOfRows) throws CMException
pNumberOfRows
- The number of rows the returned RowCollection should contain. The actual number of rows
it contains may be less than this value (if there weren't enough rows in the database). If there are no
"next rows" an empty RowCollection is returned. The hasNextRowCollection()
method can be used to test for this case.
CMException
public RowCollection getPreviousRowCollection() throws CMException
pNumberOfRows
before the first row of this
RowCollection, except for cases where there aren't enough "previous rows". In those cases its first row will
be the first row of the ResultSet. So if the first row of this RowCollection is the first row of the
ResultSet, then the returned RowCollection may contain the same rows as this RowCollection. You can use the
hasPreviousRowCollection()
method to check for this case.
If rows in the database have been inserted/deleted/updated between the time this RowCollection was
created and the invocation of this method, it is possible for rows to be duplicated (included in both this
RowCollection and the returned RowCollection) or missing (included in neither).
The number of rows in the new RowCollection is the same as the number of rows that were originally in this
RowCollection, unless there aren't enough rows in the database.
CMException
public RowCollection getPreviousRowCollection(int pNumberOfRows) throws CMException
pNumberOfRows
before the first row of this
RowCollection, except for cases where there aren't enough "previous rows". In those cases its first row will
be the first row of the ResultSet. So if the first row of this RowCollection is the first row of the
ResultSet, then the returned RowCollection may contain the same rows as this RowCollection. You can use the
hasPreviousRowCollection()
method to check for this case.
If rows in the database have been inserted/deleted/updated between the time this RowCollection was
created and the invocation of this method, it is possible for rows to be duplicated (included in both this
RowCollection and the returned RowCollection) or missing (included in neither).
pNumberOfRows
- The number of rows the returned RowCollection should contain; the actual number of contained
rows might be fewer if there aren't enough rows in the table.
CMException
public PropertyGroup getPropertyGroup(String groupName)
public PropertyGroupList getPropertyGroups()
public List getPropertyGroups(String groupName)
public ResultSet getResultSet()
public int getRetrievedRowCount()
size()
and {@link #getRowCount() getRowCount()) methods return the number of rows that are currently in this
RowCollection, which may not be the same as the value returned by this method.
public Row getRow(int i)
public int getRowCount()
public List getRows()
public List getSortedColumnNames()
public boolean getSortedColumnNamesAscending()
public String getSQL()
public SQLContext getSQLContext()
public double getSum(String fieldName) throws CMException
CMException
public String getSystemAlias()
public Table getTable()
public String getTableName()
public TableCollection getTables()
public long getTimestamp()
public String getTitle()
public ValidationExceptionCollection getValidationExceptions()
public double getValueAsDouble(int rowIndex, int fieldIndex)
public double getValueAsDouble(int rowIndex, String fieldName)
public StringBuffer getXMLData(StringBuffer pXMLData)
getXMLData
in interface IXMLObject
public StringBuffer getXMLData(XMLFileDescriptor pDescriptor, StringBuffer pXMLData)
pDescriptor
- Describes how the XML data should be generatedpublic StringBuffer getXMLHeaderData(StringBuffer pXMLData)
Creation date: (2/12/2002 5:42:05 PM)
public StringBuffer getXMLHeaderData(XMLFileDescriptor pDescriptor, StringBuffer pXMLData)
Creation date (2/12/2002 5:42:05 PM)
pDescriptor
- Describes what XML data to writepXMLData
- StringBuffer to write to
public void handleDistributed(String pActionName) throws DistributedException
DistributedException
public boolean hasConnectedChildren()
public boolean hasNextRowCollection()
public boolean hasPreviousRowCollection()
public int indexOf(Object pRow)
Returns the index in this list of the first occurrence of the specified row, or -1 if this list does not contain this row. More formally, returns the lowest index i such that o == get(i), or -1 if there is no such index.
This method checks for equality using the ==
operator, not the
equals()
method!
indexOf
in interface List
public int indexOf(String fieldName)
fieldName
- the name of the field find the index of.
public int insert() throws CMException
CMException
public int insert(Connection conn) throws CMException, DistributedException
CMException
DistributedException
public int insert(SQLContext context) throws CMException
Inserts all the rows in this RowCollection into the database. If the
isBatch()
method of the SQLContext
returns true, then that SQLContext is passed to the
insertBatch(SQLContext)
method for batch insertion. If this is the
case you should make sure this RowCollection meets the rules listed in that method for batch insertion.
Otherwise, each Row in this RowCollection is inserted individually into the database.
context
- Describes how the insertion should take place. It is not neccesary to set the system alias
or connection on the SQLContext.
CMException
public int insert(ExecutingContext ec) throws CMException
CMException
public int insertBatch() throws CMException
CMException
public boolean isARow()
public boolean isARowCollection()
public boolean isCloneNeeded()
INavigationObject
isCloneNeeded
in interface INavigationObject
public boolean isCurrent()
public boolean isEmpty()
isEmpty
in interface List
public boolean isFromCache()
public boolean isFromGroupBy()
public boolean isFromJoin()
public boolean isGraphable() throws CMException
CMException
public boolean isHasColumnNames(List columns) throws CMException
CMException
public boolean isHasRowEventListners()
public boolean isLocked()
public boolean isOkToReturnMeFromCache(SQLContext pSQLContext)
SQLContext
,
DataEngineCache
public boolean isRowCollectionContainEditableRow(ExecutingContext ec)
ec
- context in which application is executing.
public boolean isValidateRequired()
public Iterator iterator()
iterator
in interface List
public int lastIndexOf(Object row)
lastIndexOf
in interface List
row
- the row to search for.
public ListIterator listIterator()
listIterator
in interface List
public ListIterator listIterator(int index)
listIterator
in interface List
index
- index of first Row to be returned from the
list iterator (by a call to the next method).
IndexOutOfBoundsException
- if the index is out of range (index
< 0 || index > size()).public Row newRow() throws DataEngineException
DataEngineException
public Row newRow(int index) throws DataEngineException
DataEngineException
public RowCollection prepareForDisplay(ExecutingContext ec) throws CMException
CMException
public RowCollection prepareForResults(ExecutingContext pEc) throws CMException
CMException
public RowCollection prepareForReturnFromCache(ExecutingContext ec)
public RowCollection prepareFromFieldNames(List pNames) throws CMException
CMException
public void reconcile() throws CMException
CMException
public void reconcile(Connection conn) throws CMException
CMException
public RowCollection refresh() throws CMException
CMException
public RowCollection refreshIfNeeded() throws CMException
CMException
public Object remove(int i)
remove
in interface List
public boolean remove(Object row)
remove
in interface List
row
- The row to remove. (This must be a Row or a subclass of Row.)
public boolean removeAll(Collection rows)
removeAll
in interface List
rows
- A Collection which must contain only Row objects, or objects which are subclasses of Row.
public boolean removeAllRows()
public Object removeAttribute(Object key)
public void removeNavigationKey()
removeNavigationKey
in interface INavigationObject
public Row removeRow(int i)
public boolean removeRow(Row row)
row
- The row to remove.
public boolean removeRow(Row row, List fieldNames)
row
- The row to remove.fieldNames
- List of Field names whose values will be checked for equality
public boolean removeRowBasedOnKeyValues(Row row) throws CMException
row
- The row to remove.
CMException
public void removeRowEventListener(IRowEventListener pNewListener)
public void removeTable(Table table)
public final void replaceRow(Row oldRow, Row newRow)
public boolean retainAll(Collection rows)
retainAll
in interface List
rows
- a group of Row objects (or object which are subclasses of Row) to be retained in this collection.
UnsupportedOperationException
- if the retainAll method
is not supported by this Collection.remove(Object)
,
contains(Object)
public RowCollection rollbackChanges() throws CMException
CMException
public boolean rowAltered(SQLContext context, ExecutingContext ec) throws CMException
context
- The SQLContext containing the alteration information. You can invoke the getSourceRow() method on it
to get the particular row which was altered. You should use the SQLContext and not the ExecutingContext
to determine if the Row is being updated, deleted, or inserted.ec
- The current executing context. You should use the SQLContext and not the ExecutingContext
to determine if the Row is being updated, deleted, or inserted.
CMException
public Object set(int index, Object row)
set
in interface List
index
- index of row to replace.row
- the row to be stored at the specified position.
UnsupportedOperationException
- if the set method is not
supported by this list.
ClassCastException
- if the class of the specified row
prevents it from being added to this list.
IllegalArgumentException
- if some aspect of the specified
row prevents it from being added to this list.
IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()).public void setAttribute(Object key, Object value)
public void setColumnValues(String columnName, Object value) throws CMException
CMException
public void setContainedClass(Class containedClass)
containedClass
- Classpublic void setDistributed(boolean pDistributed)
public void setDistributedRequestorURL(URL pSource)
public void setDistributedSourceURL()
public void setDistributedTargetURL(URL pTarget)
public void setLastUpdated(long ts)
public void setNavigationKey(String key)
setNavigationKey
in interface INavigationObject
public void setPropertyGroups(PropertyGroupList propertyGroups)
public void setResultSet(ResultSet pResultSet) throws CMException
pResultSet
- java.sql.ResultSet is the result set that will
be set in this row collection for future use.
CMException
public Row setRow(int index, Row row)
index
- index of row to replace.row
- the row to be stored at the specified position.
UnsupportedOperationException
- if the set method is not
supported by this list.
ClassCastException
- if the class of the specified row
prevents it from being added to this list.
IllegalArgumentException
- if some aspect of the specified
row prevents it from being added to this list.
IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()).public void setSortedColumnNames(String[] sortedColumnNames, boolean sortedAscending)
public void setSql(String newSql) throws CMException
CMException
public void setSystemAlias(String pAlias) throws CMException
CMException
public void setTable(Table pTable)
pTable
- planetj.database.Tablepublic void setTables(List pTables)
public void setTables(TableCollection pTables)
public int size()
size
in interface List
public RowCollection sort(String[] pColumnNames, String pSortOrder) throws CMException
If this RowCollection has (Next or Previous) more rows in the database to read, then we must do a database sort which appends on an order by statement to the SQL statement and reruns the query.
Creation date: (12/11/2001 5:25:09 AM)
pColumnNames
- String[] that represents the an array of column names in the order
at which they should be sorted by
(i.e. sort by pColumnName[0] then sort by pColumn[1] etc...)pSortOrder
- String constant either ASC or DESC for sorting in ascending or descending order
CMException
public void sortInternal(String[] pColumnNames, String pSortOrder)
If this RowCollection has (Next or Previous) more rows in the database to read, then we must do a database sort which appends on an order by statement to the SQL statement and reruns the query.
Creation date: (12/11/2001 5:25:09 AM)
public List subList(int startIndex, int endIndex)
subList
in interface List
startIndex
- The index of the first row in this RowCollection to be included in the retuned List.endIndex
- The row with this index will be the first row in this RowCollection not to be
included in the returned List
public Object[] toArray()
Collection.toArray()
method.
toArray
in interface List
public Object[] toArray(Object[] array)
Collection.toArray()
method.
toArray
in interface List
array
- The array which will be used to return the contained rows (unless the array is not large
enough, in which case a new array of the same type is created and returned). This array must be able to
hold the rows in this RowCollection.
public StringBuffer toCSV(CSVFileDescriptor pCSVFileDescriptor) throws CMException
CMException
public StringBuffer toCSV(boolean pIncludeColumnHeadings, CSVFileDescriptor pCSVFileDescriptor) throws CMException
CMException
public StringBuffer toDOC(CSVFileDescriptor pFileDescriptor) throws CMException
CMException
public StringBuffer toDOC(boolean pIncludeColumnHeadings, CSVFileDescriptor pFileDescriptor) throws CMException
CMException
public StringBuffer toFDF(FDFFileDescriptor pFileDescriptor) throws CMException
CMException
public void toPDF(PDFFileDescriptor pFileDescriptor) throws CMException
Creation date: (1/22/2002 5:27:17 PM)
CMException
public String toString()
toString
in class Object
public void toUpperCase() throws CMException
CMException
public StringBuffer toXML(XMLFileDescriptor pFileDescriptor) throws CMException
CMException
public int update() throws CMException
CMException
public int update(Connection connection) throws CMException, DistributedException
connection
- Connection to use for updating
CMException
DistributedException
public int update(Connection connection, ExecutingContext ec) throws CMException, DistributedException
connection
- Connection to database to perform update withec
- current context in which to execute the update
CMException
DistributedException
public int update(ExecutingContext ec) throws CMException
ec
- context in which to execute update
CMException
public boolean validate(int pOperation, Principal pUser) throws CMException
CMException
public boolean validate(ExecutingContext context) throws CMException
CMException
public final boolean validate(ExecutingContext pContext, Principal pUser) throws CMException
CMException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |