planetj.database
Class RowCollection

java.lang.Object
  |
  +--planetj.database.RowCollection
All Implemented Interfaces:
Cloneable, Collection, IBatchProcessObject, IDistributedExecutableObject, IFDFObject, INavigationObject, IXMLObject, List, Serializable
Direct Known Subclasses:
EmailRowCollection, FilteredRowCollection, ReportBreakRowCollection, RowCollection.LinkedRowCollection

public class RowCollection
extends Object
implements Cloneable, INavigationObject, IBatchProcessObject, List, Serializable, IXMLObject, IFDFObject, IDistributedExecutableObject

Represents a group of rows from the database. Usually a RowCollection is created as a result of a database query.

Author:
PlanetJ Corporation
See Also:
Serialized Form

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

FIRST_ROW

public static final 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

See Also:
Constant Field Values

LAST_ROW

public static final 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

See Also:
Constant Field Values

className

public static final String className
Constructor Detail

RowCollection

public RowCollection()
Creates a new RowCollection


RowCollection

public RowCollection(Table table)
              throws CMException
Creates a new RowCollection for a specific table. All of the tables physical columns are included in the row collection.

Parameters:
table - The table associated with this RowCollection

RowCollection

public RowCollection(Table table,
                     List fieldNames)
              throws CMException
Creates a new RowCollection containing the given fields for a specific table.

Parameters:
table - The table associated with this RowCollection
fieldNames - A List containing the names of the fields that will be in this RowCollection
Method Detail

add

public void add(int index,
                Object row)
Inserts the specified row at the specified position in this list (optional operation). Shifts the row currently at that position (if any) and any subsequent rows to the right (adds one to their indices).

Specified by:
add in interface List
Parameters:
index - index at which the specified row is to be inserted.
row - the row to be inserted.
Throws:
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()).

add

public boolean add(Object row)
Appends the specified row to the end of this list.

Specified by:
add in interface List
Parameters:
row - The row (which must be an instance of planetj.database.Row) to append
Returns:
true (as per the general contract of Collection.add).

addAll

public boolean addAll(int index,
                      Collection rows)
Inserts all of the rows in the specified collection into this RowCollection at the specified position (optional operation). Shifts the row currently at that position (if any) and any subsequent rows to the right (increases their indices). The new rows will appear in the list in the order that they are returned by the specified collection's iterator. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)

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.

Specified by:
addAll in interface List
Parameters:
index - index at which to insert the first row from the specified collection.
Returns:
true if this list changed as a result of the call.
Throws:
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()).

addAll

public boolean addAll(Collection rows)
Appends the rows in the collection to this RowCollection

Specified by:
addAll in interface List
Parameters:
rows - A Collection, all of whose objects must either be Row objects, or subclasses of Row.
Returns:
true if this RowCollection was altered, false otherwise.

addFDRows

public int addFDRows(ResultSet pRS)
              throws CMException
CMException

addRow

public void addRow(int index,
                   Row row)
Inserts the specified row at the specified position in this list (optional operation). Shifts the row currently at that position (if any) and any subsequent rows to the right (adds one to their indices). If there are any RowCollections connected to this one, then the Row is added to each of them as the *last* Row (if that RowCollection accepts it).

Parameters:
index - index at which the specified row is to be inserted.
row - the row to be inserted
Throws:
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()).

addRow

public boolean addRow(Row row)
Appends the specified row to the end of this list. If there are any RowCollections connected to this one, then the Row is added to each of them (if that RowCollection accepts it).

Parameters:
row - The row (which must be an instance of planetj.database.Row) to append
Returns:
true (as per the general contract of Collection.add).

addRowEventListener

public void addRowEventListener(IRowEventListener pNewListener)
Adds a new Listener to this Row.


addRows

public int addRows(int pFirstRow,
                   int pRowCount,
                   ResultSet pRS)
            throws CMException
Adds rows from the results set to this RowCollection.

Parameters:
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);

To add the last ten rows in the result set to this RowCollection you could invoke this method like this:

addRows (RowCollection.LAST_ROW - 10, 10, resultSet);

Note that using the LAST_ROW constant in this manner is only supported if the ResultSet allows backward and forward scrolling. Attempting to use the LAST_ROW constant when only forward scrolling is allowed causes an exception to be thrown.
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.
Returns:
The number of rows that were actually added to this RowCollection.
CMException

addTable

public void addTable(Table table)
Adds a Table to the list of Table to which this RowCollection corresponds.


batchProcess

public void batchProcess()
Process this Object. This method may be overridden by subclasses to provide for special case processing of RowCollection's Rows.

Specified by:
batchProcess in interface IBatchProcessObject

clear

public void clear()
Removes all the rows from this RowCollection

Specified by:
clear in interface List

clearRows

public void clearRows()
Removes all the Rows from this RowCollection.


clearTables

public void clearTables()
Removes the tables associated with this row collection Creation date: (1/22/2002 5:59:14 PM)


clone

public Object clone()
Clone this RowCollection object.

Specified by:
clone in interface INavigationObject
Overrides:
clone in class Object

cloneRowCollection

public RowCollection cloneRowCollection()
                                 throws CMException
Untested method. Don't invoke.

CMException

contains

public boolean contains(Object row)
Tests if a Row is contained in this RowCollection

Specified by:
contains in interface List
Parameters:
row - A Row (or subclass of Row) which may or may not be contained in this RowCollection
Returns:
trhe if the Row is present in this RowCollection and false otherwise

contains

public boolean contains(Row row)
Tests if a Row is contained in this RowCollection

Parameters:
row - A Row which may or may not be contained in this RowCollection
Returns:
true if the Row is present in this RowCollection and false otherwise

containsAll

public boolean containsAll(Collection rows)
Tests if a group of rows are contained in this RowCollection

Specified by:
containsAll in interface List
Parameters:
rows - A Collection containing only Row objects, or objects which are subclasses of Row
Returns:
true if every one of the row in the rows Collection is present in this RowCollection, false otherwise

containsRowWithFieldsEqualTo

public 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.

Returns:
true if this RowCollection has a row with field values equal to the Row being passed in otherwise false

copyToConnection

public String copyToConnection(String outputAlias)
                        throws CMException
Copies the RowCollection to the specified Connection Alias. This method assumes that the system contains the file of the same name and in the same library as the current RowCollection.

CMException

copyToConnection

public String copyToConnection(String outputAlias,
                               String libraryName,
                               String tableName)
                        throws CMException
Copies the RowCollection to the specified Connection Alias. This method assumes that the system contains the file specified by the libraryName and tableName parameters.

CMException

copyToConnection

public String copyToConnection(SQLContext context)
                        throws CMException
Copies the RowCollection to the specified SQLContext.

CMException

createFieldDescriptor

public FieldDescriptorRow createFieldDescriptor(int columnIndex,
                                                ResultSetMetaData pRSMetaData)
                                         throws CMException
Creates a FieldDescriptor for the information at the specified index using the ResultSetMetaData.

Parameters:
pRSMetaData - ResultSetMetaData containing the information for creating the FieldDescriptor.
Returns:
IFieldDescriptor
CMException

createRowCollection

public static RowCollection createRowCollection(SQLContext context)
                                         throws DataEngineException
Creates a new RowCollection object based on the information in a SQLContext.

DataEngineException

delete

public final int delete()
                 throws CMException
Deletes all the rows in this RowCollection from the database.

CMException

delete

public final int delete(Connection conn)
                 throws CMException,
                        DistributedException
Deletes all the rows in this RowCollection from the database.

CMException
DistributedException

delete

public int delete(Connection conn,
                  ExecutingContext ec)
           throws CMException,
                  DistributedException
Deletes all the rows in this RowCollection from the database.

CMException
DistributedException

delete

public final int delete(ExecutingContext ec)
                 throws CMException
Deletes all the rows in this RowCollection from the database.

CMException

doesFieldDescriptorExist

public boolean doesFieldDescriptorExist(String pFieldName,
                                        boolean pCheckFieldDataFile)
                                 throws CMException
Checks to see if a FieldDescriptor exists for the given Field name. Also checks the FieldDataFile if specified.

Parameters:
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.
Returns:
Return whether or not a FieldDescriptor exists for the given Field name.
CMException

executeDistributedAction

public void executeDistributedAction()
                              throws DistributedException
Insert the method's description here. Creation date: (1/23/2003 2:02:40 PM)

Specified by:
executeDistributedAction in interface IDistributedExecutableObject
DistributedException

filter

public RowCollection filter(String fieldName,
                            int comparison,
                            Object obj)
                     throws CMException
Return a RowCollection that matches the filter criteria. For each Row, the specified field is compared to the passed in object.

CMException

filter

public FilteredRowCollection filter(IFilter filter)
                             throws DataEngineException
Returns a FilteredRowCollection that contains only rows which match the filter criteria. The returned RowCollection is connected to this RowCollection.

Parameters:
filter - The filter which will be used to examine each row
DataEngineException

filter

public FilteredRowCollection filter(IFilter filter,
                                    boolean connected)
                             throws DataEngineException
Returns a RowCollection of the that contains only rows which match the filter criteria.

Parameters:
filter - The filter which will be used to examine each row
connected - Whether or not the returned FilteredRowCollection should be connected to this RowCollection
DataEngineException

firstRow

public Row firstRow()
Gets the first Row, return null if no rows exists.


get

public Object get(int index)
Gets the row at the specified index

Specified by:
get in interface List

getAttribute

public Object getAttribute(Object key)
Get an attribute about the RowCollection for the given key.


getColumnCount

public int getColumnCount()
                   throws CMException
Returns the number of columns in each of the rows in this RowCollection. The columns in this RowCollection may be a subset of the columns in the database.

CMException

getColumnValues

public List getColumnValues(int columnNumber)
Gets all the values of a single column in this RowCollection. If there is no column with the specified number, the List will contain all null values.


getColumnValues

public List getColumnValues(String columnName)
Gets all the values of a single column in this RowCollection. If there is no column with the specified name, the List will contain all null values.


getColumnValuesByUsageId

public List getColumnValuesByUsageId(int usageId)
                              throws CMException
Gets all the values of a single column in this RowCollection. If there is no column with the specified usage id, the List will contain all null values.

CMException

getCompleteRowCollection

public RowCollection getCompleteRowCollection()
                                       throws CMException
Gets a RowCollection containing Rows having all Fields using the same search criteria as this RowCollection. (select '*' instead of previous)

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

Returns:
RowCollection
CMException

getCompleteRowCollection

public RowCollection getCompleteRowCollection(Connection pConnection)
                                       throws CMException
Gets a RowCollection containing Rows having all Fields using the same search criteria as this RowCollection. (select '*' instead of previous)

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

Returns:
RowCollection
CMException

getConfigProperty

public final Object getConfigProperty(String key,
                                      ExecutingContext executingContext)
Get a config property for the given row.


getConnectedChildren

public Collection getConnectedChildren()
Gets the child RowCollections which are connected to this one. The Collection cannot be altered.


getContainedClass

public Class getContainedClass()
Gets the type of Row (or subclass of Row) contained in this RowCollection

Returns:
Class

getDistributedRequestorURL

public URL getDistributedRequestorURL()
Insert the method's description here. Creation date: (1/28/2003 1:15:28 AM)


getEstimatedSize

public long getEstimatedSize()
Gets the estimated number of bytes of all field values in this RowCollection take up.


getExternalName

public String getExternalName(String fieldName)
                       throws CMException
Gets the external name of a field

CMException

getExternalNames

public List getExternalNames()
                      throws CMException
Gets the external names of this RowCollection's fields

CMException

getExternalNames

public List getExternalNames(List fieldNames)
                      throws CMException
Gets the external names of the specified fields of this RowCollection

CMException

getFDFData

public StringBuffer getFDFData(StringBuffer pFDFData)
This returns a StringBuffer containing all necessary FDF data for this object. Creation date: (2/4/2002 1:26:27 PM)

Specified by:
getFDFData in interface IFDFObject

getFieldCount

public int getFieldCount()
Gets the number of Fields each Row has in this RowCollection.

Returns:
int

getFieldDescriptor

public FieldDescriptorRow getFieldDescriptor(String pFieldName)
                                      throws CMException
Returns the field descriptor associated with the given field name.

Parameters:
pFieldName - String
Returns:
FieldDescriptorRow
CMException

getFieldDescriptorCollection

public FieldDescriptorCollection getFieldDescriptorCollection()
                                                       throws CMException
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.

Returns a Map of FieldDescriptors for this RowCollection's Table.

CMException

getFieldDescriptorCollection

public FieldDescriptorCollection getFieldDescriptorCollection(Table pTable)
                                                       throws CMException
Deprecated. Use Table.getFieldDescriptorCollection() instead

Returns a Map of FieldDescriptors for this RowCollection's Table.

Returns:
FieldDescriptorCollection
CMException

getFieldDescriptors

public List getFieldDescriptors()
                         throws CMException
Gets a List containing the field descriptors used for this RowCollection

CMException

getFieldDescriptorsWithUsage

public List getFieldDescriptorsWithUsage()
                                  throws CMException
Get a Collection of FieldDescriptorRows for this Row that have a UsageId defined for them.

Returns:
List
CMException

getFieldDescriptorsWithUsageId

public List getFieldDescriptorsWithUsageId(int usageId)
                                    throws CMException
Get a Collection of FieldDescriptorRows for this Row that have the given UsageId defined for them.

Returns:
List
CMException

getFieldDescriptorWithUsageId

public FieldDescriptorRow getFieldDescriptorWithUsageId(int usageId)
                                                 throws CMException
Get a FieldDescriptorRow for this Row that have the given usage id defined for them. If more than one FD has the given usage id, the first one is returned.

Returns:
FieldDescriptorRow
CMException

getFieldNames

public List getFieldNames()
Returns a List of names of the Fields in each Row.

Returns:
List

getFieldNameSets

public List getFieldNameSets()
                      throws CMException
Gets a List of FieldSets, containing the *NAMES* of fields in that field set. Note that names of fields which are not in this RowCollection may be included.

CMException

getFields

public List getFields(String columnName)
Gets all the Fields of a single column in this RowCollection. If there is no column with the specified name, the List will contain all null values.


getFieldsToDisplay

public List getFieldsToDisplay()
Return a List of all the Field names that will be displayed by default.

Returns:
List

getFieldsToDisplayStrict

public List getFieldsToDisplayStrict(List fieldNames,
                                     ExecutingContext pEc)
Return a List of all the Field names that will be displayed by default. Same as getFieldsToDisplay except checks for DISPLAY_RULE_NEVER and !isAuthorizedForRead();

Returns:
List

getFieldsToDisplayStrict

public List getFieldsToDisplayStrict(ExecutingContext pEc)
Return a List of all the Field names that will be displayed by default. Same as getFieldsToDisplay except checks for DISPLAY_RULE_NEVER and !isAuthorizedForRead();

Returns:
List

getGraphableFieldNames

public List getGraphableFieldNames()
                            throws CMException
Inspects this RowCollection to determine which of its Fields are graphable.

Returns:
List of Field names that contain graphable values.
CMException

getJoinFieldNames

public List getJoinFieldNames()
Gets the names of fields to join on. This is only used when joining two RC's using an associated join operation. By default, no names are returned, indicating that the field whose FD specifies the join operation is the only join field. Subclasses can override to specify mulitple fields.


getLastUpdated

public long getLastUpdated()
Gets the time when this RowCollection was last updated.


getLibraryName

public String getLibraryName()

getMetaDataSystemAlias

public String getMetaDataSystemAlias()
Returns the meta data alias of the system to which this RowCollection belongs

Returns:
String

getNavigationKey

public String getNavigationKey()
Get the key used to store/retrieve this RowCollection to/from navigation.

Specified by:
getNavigationKey in interface INavigationObject

getNavigationListKey

public String getNavigationListKey()
Get the key used to store and retrieve a List of RowCollections that have been put into navigation. If any subclasses need to be grouped separate, they can override this method and specify their own navigation list key.

Specified by:
getNavigationListKey in interface INavigationObject

getNextRowCollection

public RowCollection getNextRowCollection()
                                   throws CMException
Gets a RowCollection containing another group of rows which satisfy the query that was used to create this RowCollection. This method may result in an additional query to the database. If the last row in this RowCollection was row number X, then the first row in the returned RowCollection will be row X + 1. 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. If there are no "next rows" an empty RowCollection is returned. The hasNextRowCollection() method can be used to test for this case.

CMException

getNextRowCollection

public RowCollection getNextRowCollection(int pNumberOfRows)
                                   throws CMException
Gets a RowCollection containing another group of rows which satisfy the query that was used to create this RowCollection. This method may result in an additional query to the database. If the last row in this RowCollection was row number X, then the first row in the returned RowCollection will be row X + 1. 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).

Parameters:
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

getPreviousRowCollection

public RowCollection getPreviousRowCollection()
                                       throws CMException
Gets a RowCollection containing another group of rows which satisfy the query that was used to create this RowCollection. This method may result in an additional query to the database. The returned RowCollection's first row will be 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

getPreviousRowCollection

public RowCollection getPreviousRowCollection(int pNumberOfRows)
                                       throws CMException
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. This method may result in an additional query to the database. The returned RowCollection's first row will be 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).

Parameters:
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

getPropertyGroup

public PropertyGroup getPropertyGroup(String groupName)
Gets the first PropertyGroup with the given property group name.


getPropertyGroups

public PropertyGroupList getPropertyGroups()
Get all the property groups stored in this RowCollection's attributes.


getPropertyGroups

public List getPropertyGroups(String groupName)
Get this RowCollection's property groups with the given group name.


getResultSet

public ResultSet getResultSet()
Returns the result set that was set within this row collection.

Returns:
java.sql.ResultSet

getRetrievedRowCount

public int getRetrievedRowCount()
Gets the total number of database rows that have been added to this RowCollection as a result of a database query. The 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.


getRow

public Row getRow(int i)
Gets the Row with the specified index out of this RowCollection. The first Row has an index of 0.


getRowCount

public int getRowCount()
Returns the number of Rows in this RowCollection.

Returns:
int

getRows

public List getRows()
Returns a List of Rows contained within this RowCollection. The List cannot be modified.


getSortedColumnNames

public List getSortedColumnNames()
Get the names of columns that have been sorted on. Creation date: (10/24/2003 12:49:15 PM)


getSortedColumnNamesAscending

public boolean getSortedColumnNamesAscending()
Return true is the columns sorted on where in ascending order. Creation date: (10/24/2003 12:49:15 PM)


getSQL

public String getSQL()
Gets the SQL statement which was used to create this RowCollection.


getSQLContext

public SQLContext getSQLContext()
Gets the SQL context that was used to create this RowCollection. Altering this context may introduce subtle errors to the system.


getSum

public double getSum(String fieldName)
              throws CMException
Returns a double which is the sum of the rows for the requested column value. 0 is returned if the column doesn't represent a number.

CMException

getSystemAlias

public String getSystemAlias()
Gets the alias to the system to connect to


getTable

public Table getTable()
Gets the table object for this RowCollection.


getTableName

public String getTableName()

getTables

public TableCollection getTables()

getTimestamp

public long getTimestamp()
Gets the time when this RowCollection was created. ***This may be different than the time when it was last updated***


getTitle

public String getTitle()
Gets the title of this RowCollection


getValidationExceptions

public 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. A collection of all exceptions from each field is returned

Returns:
exception collection

getValueAsDouble

public double getValueAsDouble(int rowIndex,
                               int fieldIndex)

getValueAsDouble

public double getValueAsDouble(int rowIndex,
                               String fieldName)

getXMLData

public StringBuffer getXMLData(StringBuffer pXMLData)
Deprecated. Use the method which takes a XMLDescriptor as a parameter

This returns a StringBuffer containing all necessary XML data for this object. Creation date: (1/21/2002 7:01:36 PM)

Specified by:
getXMLData in interface IXMLObject

getXMLData

public StringBuffer getXMLData(XMLFileDescriptor pDescriptor,
                               StringBuffer pXMLData)
This returns a StringBuffer containing all necessary XML data for this object. Creation date: (1/21/2002 7:01:36 PM)

Parameters:
pDescriptor - Describes how the XML data should be generated

getXMLHeaderData

public StringBuffer getXMLHeaderData(StringBuffer pXMLData)
This returns a StringBuffer containing all XMLHeader data for this RowCollection. This information will be commented in the XML file and used for information only

Creation date: (2/12/2002 5:42:05 PM)


getXMLHeaderData

public StringBuffer getXMLHeaderData(XMLFileDescriptor pDescriptor,
                                     StringBuffer pXMLData)
This returns a StringBuffer containing all XMLHeader data for this RowCollection. This information will be commented in the XML file and used for information only

Creation date (2/12/2002 5:42:05 PM)

Parameters:
pDescriptor - Describes what XML data to write
pXMLData - StringBuffer to write to
Returns:
StringBuffer containing XMLHeader data for this RowCollection

handleDistributed

public void handleDistributed(String pActionName)
                       throws DistributedException
Set the method that will be called after Row is deserialized on the target. Serialize this Row and attempt to upload to the target. Creation date: (1/23/2003 3:46:33 PM)

DistributedException

hasConnectedChildren

public boolean hasConnectedChildren()
Tests if this RowCollection has connected children


hasNextRowCollection

public 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. Note that if there is a maximum limit set on the number of rows a ResultSet can contain, then it is possible for this method to return false when in fact more rows do exist for the query (but were not in the ResultSet).


hasPreviousRowCollection

public 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.


indexOf

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!

Specified by:
indexOf in interface List
Returns:
the index in this list of the first occurrence of the specified row, or -1 if this list does not contain this row.

indexOf

public 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.

Parameters:
fieldName - the name of the field find the index of.
Returns:
the index in of the first occurrence of the specified field name, or -1 if not in this RowCollection's Rows

insert

public int insert()
           throws CMException
Inserts all the rows in this RowCollection into the database.

CMException

insert

public int insert(Connection conn)
           throws CMException,
                  DistributedException
Inserts all the rows in this RowCollection into the database.

CMException
DistributedException

insert

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.

Parameters:
context - Describes how the insertion should take place. It is not neccesary to set the system alias or connection on the SQLContext.
CMException

insert

public int insert(ExecutingContext ec)
           throws CMException
Inserts all the rows in this RowCollection into the database.

CMException

insertBatch

public int insertBatch()
                throws CMException
Inserts all the Rows in this RowCollection into the database in a single batch. This method should only be invoked in the following cases:

Returns:
The number of rows successfully inserted. (Rows are inserted one at a time, beginning with the first row. Row insertion is halted if any individual insert statement fails.)
CMException

isARow

public boolean isARow()
Return a boolean indicating if this object is a Row

Returns:
boolean

isARowCollection

public boolean isARowCollection()
Return a boolean indicating if this object is a RowCollection

Returns:
boolean

isCloneNeeded

public boolean isCloneNeeded()
Description copied from interface: INavigationObject
Test to see if tiis navigation object should be clone upon storing and retrieving.

Specified by:
isCloneNeeded in interface INavigationObject

isCurrent

public 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.


isEmpty

public boolean isEmpty()
Returns whether or not this RowCollection is empty.

Specified by:
isEmpty in interface List
Returns:
boolean

isFromCache

public boolean isFromCache()
Return whether or not this RowCollection was returned from Cache

Returns:
boolean (True if returned from Cache, false if returned from a database hit

isFromGroupBy

public boolean isFromGroupBy()
Return whether or not this Row was created with a group by in the SQL clause.

Returns:
boolean

isFromJoin

public boolean isFromJoin()
Return whether or not this Row was created from a join.

Returns:
boolean

isGraphable

public boolean isGraphable()
                    throws CMException
Checks to see if this RowCollection could possibly be charted or graphed. A RowCollection by default is graphable if it contains one numeric value.

Returns:
whether or not this RowCollection is graphable
CMException

isHasColumnNames

public boolean isHasColumnNames(List columns)
                         throws CMException
Checks to see if this RowCollection has all the columns in the given List.

CMException

isHasRowEventListners

public boolean isHasRowEventListners()

isLocked

public boolean isLocked()
Tests if this RowCollection is locked. Locked RowCollections cannot have rows added or removed


isOkToReturnMeFromCache

public boolean isOkToReturnMeFromCache(SQLContext pSQLContext)
Return a boolean indicating if it is ok to return this RowCollection for the specified SQLContext. The CacheManger uses the SQLContext hashcode first then this method when determining if a RC can be returned for a given query.

Returns:
boolean
See Also:
SQLContext, DataEngineCache

isRowCollectionContainEditableRow

public boolean isRowCollectionContainEditableRow(ExecutingContext ec)
Check to see if this RowCollection contains an editable Row.

Parameters:
ec - context in which application is executing.
Returns:
true if RowCollection does not have an editable Row; false otherwise.

isValidateRequired

public boolean isValidateRequired()
Tests if this Row must be validated before it is inserted/updated


iterator

public Iterator iterator()
Returns an iterator which iterates through the Rows of this RowCollection

Specified by:
iterator in interface List

lastIndexOf

public 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. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Specified by:
lastIndexOf in interface List
Parameters:
row - the row to search for.
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

public ListIterator listIterator()
Deprecated. Avoid calling this method if possible - row removal isn't supported correctly

Returns a list iterator of the Rows in this RowCollecton (in proper sequence).

Specified by:
listIterator in interface List
Returns:
a list iterator of the Rows in this list (in proper sequence), starting at the specified position in this list.

listIterator

public ListIterator listIterator(int index)
Deprecated. Avoid calling this method if possible - row removal isn't supported correctly

Returns a list iterator of the Rows in this RowCollecton (in proper sequence), starting at the specified position in this list. The specified index indicates the first Row that would be returned by an initial call to the next method. An initial call to the previous method would return the Row with the specified index minus one.

Specified by:
listIterator in interface List
Parameters:
index - index of first Row to be returned from the list iterator (by a call to the next method).
Returns:
a list iterator of the Rows in this list (in proper sequence), starting at the specified position in this list.
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index > size()).

newRow

public Row newRow()
           throws DataEngineException
Creates, adds, and returns a new Row from this RowCollection. The new Row is not initialized

Returns:
Row
DataEngineException

newRow

public Row newRow(int index)
           throws DataEngineException
Creates, adds, and returns a new Row from this RowCollection. The new Row is not initialized

Returns:
Row
DataEngineException

prepareForDisplay

public RowCollection prepareForDisplay(ExecutingContext ec)
                                throws CMException
This method is intended for subclass to override and provide their own functionality. It is currently being used in the HTML table to allow alteration of row collection before rows are displayed.

CMException

prepareForResults

public RowCollection prepareForResults(ExecutingContext pEc)
                                throws CMException
Gets the a proper RowCollection for viewing this RowCollections results. Includes actions like skinnying or getting additional fields not already included.

CMException

prepareForReturnFromCache

public RowCollection prepareForReturnFromCache(ExecutingContext ec)
This method is intended for subclasses to override and provide their own functionality if needed. This method is called when a RowCollection is being returned from the DataEngine cache. Subclasses can do anything they want such as maintaining a count, refreshing data, etc.

Returns:
RowCollection

prepareFromFieldNames

public RowCollection prepareFromFieldNames(List pNames)
                                    throws CMException
Gets the a proper RowCollection for viewing this RowCollections results. Includes actions like skinnying or getting additional fields not already included.

CMException

reconcile

public void reconcile()
               throws CMException
Reconciles the database, using all the rows in this RowCollection and checking to see if there are concurrent updates.

CMException

reconcile

public void reconcile(Connection conn)
               throws CMException
Reconciles the database, using all the rows in this RowCollection and checking to see if there are concurrent updates.

CMException

refresh

public RowCollection refresh()
                      throws CMException
This method will refresh this RowCollection from the database and return this. Creation date: (12/10/2001 3:55:47 PM)

CMException

refreshIfNeeded

public RowCollection refreshIfNeeded()
                              throws CMException
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.

CMException

remove

public Object remove(int i)
Removes the row with the specified index from this RowCollection. The first row has an index of 0. That Row is also removed from any connected RowCollections.

Specified by:
remove in interface List

remove

public boolean remove(Object row)
Removes the row from this RowCollection. It is also removed from any connected RowCollections, but only if it originally existed in this RowCollection.

Specified by:
remove in interface List
Parameters:
row - The row to remove. (This must be a Row or a subclass of Row.)
Returns:
true if the Row was originally contained in this RowCollection, false otherwise

removeAll

public boolean removeAll(Collection rows)
Removes all the Rows contained in the Collection from this RowCollection.

Specified by:
removeAll in interface List
Parameters:
rows - A Collection which must contain only Row objects, or objects which are subclasses of Row.
Returns:
true if any rows were removed from this collection, false otherwise.

removeAllRows

public boolean removeAllRows()
Removes all the rows in this RowCollection


removeAttribute

public Object removeAttribute(Object key)
Remove an attribute about the RowCollection for the given key.


removeNavigationKey

public void removeNavigationKey()
Clears out any navigation key that may have been set on this RowCollection.

Specified by:
removeNavigationKey in interface INavigationObject

removeRow

public Row removeRow(int i)
Removes the row with the specified index from this RowCollection (the first row has an index of 0). That Row is also removed from any connected RowCollections.


removeRow

public boolean removeRow(Row row)
Removes the row from this RowCollection. It is also removed from any connected RowCollections, but only if it originally existed in this RowCollection.

Parameters:
row - The row to remove.
Returns:
true if the Row was originally contained in this RowCollection, false otherwise

removeRow

public boolean removeRow(Row row,
                         List fieldNames)
Removes the row from this RowCollection. It is also removed from any connected RowCollections, but only if it originally existed in this RowCollection. If the values that exist in the key fields corresponding to the List of field names passed in are equal, then the corresponding row is removed.

Parameters:
row - The row to remove.
fieldNames - List of Field names whose values will be checked for equality
Returns:
true if the Row was originally contained in this RowCollection, false otherwise

removeRowBasedOnKeyValues

public boolean removeRowBasedOnKeyValues(Row row)
                                  throws CMException
Removes the row from this RowCollection. It is also removed from any connected RowCollections, but only if it originally existed in this RowCollection. If the values that exist in the key fields are equal, then the corresponding row is removed.

Parameters:
row - The row to remove.
Returns:
true if the Row was originally contained in this RowCollection, false otherwise
CMException

removeRowEventListener

public void removeRowEventListener(IRowEventListener pNewListener)
Removes a Listener from this Row


removeTable

public void removeTable(Table table)
Removes a Table to the list of Table to which this RowCollection corresponds.


replaceRow

public final void replaceRow(Row oldRow,
                             Row newRow)
Replaces one Row in this RowCollection with another Row. If the old Row is not in this RowCollection, then this method does not alter this RowCollection (although other connected RowCollections may be affected).


retainAll

public boolean retainAll(Collection rows)
Retains only the elements in this collection that are contained in the specified collection. In other words, removes from this collection all of its elements that are not contained in the specified collection.

Specified by:
retainAll in interface List
Parameters:
rows - a group of Row objects (or object which are subclasses of Row) to be retained in this collection.
Returns:
true if this collection changed as a result of the call
Throws:
UnsupportedOperationException - if the retainAll method is not supported by this Collection.
See Also:
remove(Object), contains(Object)

rollbackChanges

public RowCollection rollbackChanges()
                              throws CMException
Undoes any changes that have been made to this RowCollection since it was read from or written to the database. This method will not undo any changes that have been saved to the database.

Returns:
This RowCollection is returned.
CMException

rowAltered

public boolean rowAltered(SQLContext context,
                          ExecutingContext ec)
                   throws CMException
This method is invoked when this RowCollection is in the cache, and a single row is deleted, inserted, or updated. If this row collection can still remain in the cache then any necessary modifications should be made to it and true should be returned. If false is returned then this RC will be removed from the cache.

Parameters:
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.
Returns:
Whether or not this RC can remain in the cache
CMException

set

public Object set(int index,
                  Object row)
Replaces the row at the specified position in this list with the specified row (optional operation).

Specified by:
set in interface List
Parameters:
index - index of row to replace.
row - the row to be stored at the specified position.
Returns:
the row previously at the specified position.
Throws:
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()).

setAttribute

public void setAttribute(Object key,
                         Object value)
Set the given attribute about the RowCollection for the given key.


setColumnValues

public void setColumnValues(String columnName,
                            Object value)
                     throws CMException
Sets all the row values of a single column in this RowCollection.

CMException

setContainedClass

public void setContainedClass(Class containedClass)
Sets the type of Row (or subclass of Row) contained in this RowCollection

Parameters:
containedClass - Class

setDistributed

public void setDistributed(boolean pDistributed)
Should be set to true if serialized and distributed for web services. Creation date: (1/23/2003 2:09:22 PM)


setDistributedRequestorURL

public void setDistributedRequestorURL(URL pSource)
Insert the method's description here. Creation date: (1/28/2003 1:15:28 AM)


setDistributedSourceURL

public void setDistributedSourceURL()
Insert the method's description here. Creation date: (1/28/2003 1:15:28 AM)


setDistributedTargetURL

public void setDistributedTargetURL(URL pTarget)
Insert the method's description here. Creation date: (1/23/2003 3:33:22 PM)


setLastUpdated

public void setLastUpdated(long ts)
Sets the last time this RowCollection was updated


setNavigationKey

public void setNavigationKey(String key)
Set the key used to store/retrieve this RowCollection to/from navigation.

Specified by:
setNavigationKey in interface INavigationObject

setPropertyGroups

public void setPropertyGroups(PropertyGroupList propertyGroups)
Set the property groups stored in this RowCollection's attributes.


setResultSet

public void setResultSet(ResultSet pResultSet)
                  throws CMException
Sets the result set on the row collection. The result set is only set if the SQL Context associated with this row collection returns true from a call to SQLContext.isResultSetRetained().

Parameters:
pResultSet - java.sql.ResultSet is the result set that will be set in this row collection for future use.
CMException

setRow

public Row setRow(int index,
                  Row row)
Replaces the row at the specified position in this list with the specified row (optional operation).

Parameters:
index - index of row to replace.
row - the row to be stored at the specified position.
Returns:
the row previously at the specified position.
Throws:
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()).

setSortedColumnNames

public void setSortedColumnNames(String[] sortedColumnNames,
                                 boolean sortedAscending)
Set the names of columns that have been sorted on. Creation date: (10/24/2003 12:49:15 PM)


setSql

public void setSql(String newSql)
            throws CMException
Sets the SQL string used to create this RowCollection. In most cases, this method should not be invoked.

CMException

setSystemAlias

public void setSystemAlias(String pAlias)
                    throws CMException
Sets the alias of the system containing the database where this RowCollection's rows are stored. In most cases, this method should not be invoked.

CMException

setTable

public void setTable(Table pTable)
Sets the table that is associated with this row collection Creation date: (1/22/2002 5:59:14 PM)

Parameters:
pTable - planetj.database.Table

setTables

public void setTables(List pTables)
Deprecated. Pass in a TableCollection instead

Sets the tables associated with this row collection Creation date: (1/22/2002 5:59:14 PM)


setTables

public void setTables(TableCollection pTables)
Sets the tables associated with this row collection Creation date: (1/22/2002 5:59:14 PM)


size

public int size()
Returns the number of Rows in this RowCollection.

Specified by:
size in interface List
Returns:
int

sort

public RowCollection sort(String[] pColumnNames,
                          String pSortOrder)
                   throws CMException
Sorts the Rows in this RowCollection.

If this RowCollection contains all rows from its database table, then we can do an internal sort. With an internal sort, there is no database communication. It's all done in memory.

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)

Parameters:
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
Returns:
This RowCollection after its rows have been sorted
CMException

sortInternal

public void sortInternal(String[] pColumnNames,
                         String pSortOrder)
If this RowCollection contains all rows from its database table, then we can do an internal sort. With an internal sort, there is no database communication. Its all done in memory.

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)


subList

public List subList(int startIndex,
                    int endIndex)
Returns a view of this RowCollection.

Specified by:
subList in interface List
Parameters:
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
Returns:
A List (at this time, the returned List is not a RowCollection) containing some of the rows in this RowCollection. The returned List cannot be altered.

toArray

public Object[] toArray()
Returns the Row objects contained in this RowCollection in an array, as described by the Collection.toArray() method.

Specified by:
toArray in interface List
Returns:
An object of type Row[], which contains the Row objects contained in this RowCollection.

toArray

public Object[] toArray(Object[] array)
Returns the Row objects contained in this RowCollection in an array, as described by the Collection.toArray() method.

Specified by:
toArray in interface List
Parameters:
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.
Returns:
An array which contains the Row objects contained in this RowCollection.

toCSV

public StringBuffer toCSV(CSVFileDescriptor pCSVFileDescriptor)
                   throws CMException
Returns a StringBuffer in CSV format containing all data in this RowCollection. Creation date: (12/6/2001 2:14:48 PM)

CMException

toCSV

public StringBuffer toCSV(boolean pIncludeColumnHeadings,
                          CSVFileDescriptor pCSVFileDescriptor)
                   throws CMException
Deprecated.  

Returns a StringBuffer in CSV format containing all data in this RowCollection. Creation date: (12/6/2001 2:14:48 PM)

CMException

toDOC

public StringBuffer toDOC(CSVFileDescriptor pFileDescriptor)
                   throws CMException
Returns a StringBuffer in Microsoft Word .doc format containing all data in this RowCollection. Creation date: (2/13/2002 1:09:43 PM)

CMException

toDOC

public StringBuffer toDOC(boolean pIncludeColumnHeadings,
                          CSVFileDescriptor pFileDescriptor)
                   throws CMException
Deprecated.  

Returns a StringBuffer in Microsoft Word .doc format containing all data in this RowCollection. Creation date: (2/13/2002 1:09:43 PM)

CMException

toFDF

public StringBuffer toFDF(FDFFileDescriptor pFileDescriptor)
                   throws CMException
Returns a StringBuffer in FDF format containing all data in this RowCollection. Creation date: (2/4/2002 5:23:41 PM)

CMException

toPDF

public void toPDF(PDFFileDescriptor pFileDescriptor)
           throws CMException
Generates a PDF file from this RowCollection. The output will be sent to the ServletOutputStream if there is no fileName specified in pFileDescriptor, else the output will be sent to that file.

Creation date: (1/22/2002 5:27:17 PM)

CMException

toString

public String toString()
Returns a String representation of this RowCollection.

Overrides:
toString in class Object
Returns:
String

toUpperCase

public void toUpperCase()
                 throws CMException
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. Dates must be UPPERCASED incase the date format in the DB contains acutal month or day or timezone info Example: Tue May 14 12:23:53 PDT 2002 Times must be UPPERCASED incase the date format in the DB contains acutal month or day or timezone info Example: 14 May 2002 19:26:13 GMT Creation date: (5/14/2002 12:44:50 PM)

CMException

toXML

public StringBuffer toXML(XMLFileDescriptor pFileDescriptor)
                   throws CMException
Returns a StringBuffer in XML format containing all data in this RowCollection. Creation date: (1/21/2002 6:33:24 PM)

CMException

update

public int update()
           throws CMException
Updates the database, using all the rows in this RowCollection.

Returns:
number of rows updated
CMException

update

public int update(Connection connection)
           throws CMException,
                  DistributedException
Updates all the Rows in this RowCollection in the database.

Parameters:
connection - Connection to use for updating
Returns:
number of rows updated
CMException
DistributedException

update

public int update(Connection connection,
                  ExecutingContext ec)
           throws CMException,
                  DistributedException
Updates the database, using all the rows in this RowCollection.

Parameters:
connection - Connection to database to perform update with
ec - current context in which to execute the update
Returns:
number of rows updated
CMException
DistributedException

update

public int update(ExecutingContext ec)
           throws CMException
Updates this RowCollection's Rows in the database

Parameters:
ec - context in which to execute update
Returns:
number of rows updated in database
CMException

validate

public boolean validate(int pOperation,
                        Principal pUser)
                 throws CMException
Deprecated. Use the validate method which takes in a ExecutingContext

Validate this RowCollection's Row based on its configuration and field values. If the field values are valid, return true, if not return an exception that encapsulates the error.

Returns:
boolean true if valid else and exception will be thrown
CMException

validate

public boolean validate(ExecutingContext context)
                 throws CMException
Validate this RowCollection's Rows based on their configuration and Field values.

Returns:
true, if all Rows are valid; false otherwise.
CMException

validate

public final boolean validate(ExecutingContext pContext,
                              Principal pUser)
                       throws CMException
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.

Validate this RowCollection's Row based on its configuration and field values. If the field values are valid, return true, if not return an exception that encapsulates the error.

CMException