Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.server
Class ViewRowSetIteratorImpl

java.lang.Object
  extended byoracle.jbo.common.PropertiesHelper
      extended byoracle.jbo.common.RowSetHelper
          extended byoracle.jbo.common.RowSetIteratorHelper
              extended byoracle.jbo.server.ViewRowSetIteratorImpl
All Implemented Interfaces:
NavigatableRowIterator, Properties, RowIterator, RowSetIterator, WSRowSetIteratorMarshaller

public class ViewRowSetIteratorImpl
extends RowSetIteratorHelper
implements RowSetIterator, WSRowSetIteratorMarshaller

The middle-tier class that enables the user to iterate through row sets.

A view row set iterator blongs to a view row set. In the view row set a row's position is identified by its row index. A range is a window through which a portion of the view row set is visible. A row has an absolute index, relative to the first row in the entire view row set, and rows within the range have a range index, relative to the first row in the range. One of the rows, in the range or not, may be designated as the current row. Other objects that have interest in changes to a view row set's data, current row designation, and range may be registered as listeners by calling addListener(). Listeners must implement the RowSetListener interface. When a view row set iterator is created, it registers with its containing view row set. Later, when an entity row is updated, the View Object propagates it to its view row sets, which propagate the event to its listeners, including its iterator, which converts it to a view row event, and sends it to its own listeners.

Since:
JDeveloper 3.0
See Also:
ViewObject, RowSet, RowSetIterator, RowSetListener, ViewRowSetIteratorImpl

Field Summary
protected  ViewRowSetImpl mViewRowSet
           
protected  int mViewSize
           
 
Fields inherited from class oracle.jbo.common.RowSetIteratorHelper
mCurrentRow
 
Fields inherited from class oracle.jbo.common.RowSetHelper
listeners, mMgmtListeners, mName
 
Fields inherited from class oracle.jbo.common.PropertiesHelper
mProperties
 
Fields inherited from interface oracle.jbo.RowIterator
ITER_MODE_LAST_PAGE_FULL, ITER_MODE_LAST_PAGE_PARTIAL, SLOT_BEFORE_FIRST, SLOT_BEYOND_LAST, SLOT_DELETED, SLOT_VALID
 
Constructor Summary
ViewRowSetIteratorImpl(ViewRowSetImpl rowset)
          Constructs a new secondary (non-default) view row set iterator.
ViewRowSetIteratorImpl(ViewRowSetImpl rowset, java.lang.String name, boolean isDefaultRSI)
          Constructs a new view row set iterator.
 
Method Summary
 void activateIteratorState(Element node, boolean clearIteratorState)
           
protected  void addDetailViewRowSet(RowSet detailRowSet)
          ##INTERNAL##
 void addListener(java.lang.Object listener)
          Adds an event listener to this object.
 void closeRowSetIterator()
          Closes this row set iterator.
 Row createAndInitRow(AttributeList initVals)
          Creates and initializes a new Row object, but does not insert it into the Row Set.
 RowSet createDetailRowSet(java.lang.String rsName, java.lang.String linkDefName)
          Creates a detail Row Set.
 Key createKey(AttributeList nvp)
          Given a list of name-value pairs, creates a Key object that matches the key structure for the ViewObject for this RowItertor.
 Row createRow()
          Creates a new view row.
 void doInsertRow(Row row, boolean navigateToRow)
          INTERNAL: Applications should not use this method.
 java.util.Enumeration enumerateRowsInRange()
          Creates and returns an enumerator of the rows in the range.
 void findAndSetCurrentRowByKey(Key key, int rangeIndex)
           
 Row[] findByEntity(int eRowHandle, int maxNumOfRows)
          Finds and returns View rows that use the Entity row, identified by the Entity row handle, eRowHandle.
 Row[] findByKey(Key key, int maxNumOfRows)
          Finds and returns view rows that match the specified key.
 Row[] findByKey(Key key, int maxNumOfRows, boolean skipWhere)
           
static RowSetIterator findRSIForEntity(RowSetIterator[] rsis, Row eRow)
           
 void fireRowUpdated(int rowIndex, Row row, int[] attrIndices)
          Fires the row updated event to its listeners.
 Row first()
          Navigates to the first row in the row set.
 Row[] getAllRowsInRange()
          Returns an array of all rows in the iterator's range.
 Row[] getAllRowsInRangeInternal(boolean shouldEnsureRefreshed)
           
 SvcMsgIteratorState getCliIteratorState()
           
 Row getCurrentRow()
          Returns the current row of the iterator.
 int getCurrentRowIndex()
          Returns the absolute row index of the current row in the row set.
 int getCurrentRowSlot()
          Returns the current row slot status.
 RowSet[] getDetailRowSets()
          Gets an array of detail Row Sets for which this Iterator is the master.
 int getEstimatedRangePageCount()
          Returns getEstimatedRowCount()/rangePageSize, if rangeSize > 0.
 int getFetchedRowCount()
          Returns the number of rows fetched from the JDBC RestultSet.
 Row[] getFilteredRows(RowQualifier qualifier)
           
 Row[] getFilteredRows(java.lang.String attrName, java.lang.Object attrValue)
          Returns all rows in this collection whose attribute value matches the value being passed in attrValue.
 Row[] getFilteredRowsInRange(RowQualifier qualifier)
           
 Row[] getFilteredRowsInRange(java.lang.String attrName, java.lang.Object attrValue)
          Returns all rows in this range whose attribute value matches the value being passed in attrValue.
 int getIterMode()
          Gets the current iteration mode.
 Row[] getNextRangeSet()
          Gets the next set of rows in the range.
 Row[] getNextRangeSetWithAdjustment(int rangeAdjust)
           
 Row[] getPreviousRangeSet()
          Gets the previous set of rows in the range.
 java.util.Hashtable getProperties()
          Retrieves all properties.
 int getRangeIndexOf(Row row)
          Returns the range index of the row specified by row.
 int getRangeSize()
          Returns the range size of the iterator.
 int getRangeStart()
          Returns the absolute row index of the first row in the range.
 Row getRow(Key key)
          Returns the first row whose key matches key.
 Row getRowAtRangeIndex(int index)
          Returns the row at range index index.
 Row getRowAtRangeIndexInternal(int index)
          Internal: Applications should not use this method.
 int getRowCount()
          Returns the total number of rows in this row set.
 int getRowCountInRange()
          Returns the actual number of rows in the range.
 java.lang.Object[] getRowFilterValues()
           
 Row getRowFromHandle(java.lang.Object rowHandle)
          Internal: Applications should not use this method.
 RowSet getRowSet()
          Returns this row set iterator's row set (interface).
 ViewRowSetImpl getRowSetImpl()
          Returns this row set iterator's row set (implementation class).
 RowSetIterator getRowSetIterator()
          Returns the row set iterator interface of this object.
 java.lang.Object getSyncLock()
          Gets the locking object for this Row Set Iterator.
 ViewObject getViewObject()
          Returns this row set iterator's view object.
 boolean hasNext()
          Indicates whether the iterator has a next row or not.
 boolean hasPrevious()
          Indicates whether the iterator has a previous row or not.
 void insertRow(Row row)
          Inserts the row into the row set.
 void insertRowAtRangeIndex(int index, Row row)
          Inserts the row into the row set at the specified range index.
 boolean isDefaultRSI()
          Internal: Applications should not use this method.
 boolean isNameGenerated()
          Tests if the Iterator's name was generated by the system.
 boolean isRangeAtBottom()
          Indicates whether the iterator range contains the last row of the row set.
 boolean isRangeAtTop()
          Indicates whether the iterator range contains the first row of the row set.
 boolean isRefreshed()
          INTERNAL: Applications should not use this method.
 boolean isRowValidation()
          Gets the validation flag on this iterator.
 Row last()
          Navigates to the last row in the row set.
 Row next()
          Navigates to the next row in the row set.
 int nextIndex()
          Returns the absolute row index of the next row.
 void prepareForBatchMode(SvcMsgIteratorState iteratorState, boolean setCurrentRow)
          Internal: Applications should not use this method.
 void prepareRangeForBatchMode(boolean isExecuted, int currentRowIndex, int rangeStart, int rangeSize, boolean setCurrentRow)
           
 Row previous()
          Navigates to the previous row in the row set.
 int previousIndex()
          Returns the absolute row index of the previous row.
protected  void refresh(boolean resetIter, boolean fillUpRange)
           
 void removeCurrentRow()
          Removes the current row.
 Row removeCurrentRowAndRetain()
          Removes the current Row object from the collection and retain it for insertion into another location.
 void removeCurrentRowFromCollection()
          Removes the current Row object from the collection.
protected  void removeDetailViewRowSet(RowSet detailRowSet)
          ##INTERNAL##
 void removeRowAtRangeIndex(int index)
          Removes a view row at range index index.
 void removeRowHandle(java.lang.Object rowHandle)
          Internal: Applications should not use this method.
 void reset()
          Resets the iterator.
 int scrollRange(int rows)
          Scrolls the range by amount.
 int scrollRangeTo(Row row, int index)
          Scrolls the range to a specific row.
 int scrollToRangePage(int pageIndex)
          Moves the row set range start to the given page index where every page consists of RangeSize number of rows.
 boolean setCurrentRow(Row row)
          Indicates whether the cursor has been successfully moved to the row specified by row.
 boolean setCurrentRowAtRangeIndex(int index)
          Moves the iterator to the row whose range index is index.
 void setIterMode(int mode)
          Sets the iteration mode for this Row Iterator.
 int setRangeSize(int newSize)
          Sets the range size for the iterator.
 int setRangeStart(int start)
          Sets the range position by the absolute row index specified in start.
 void setRowFilterValues(java.lang.Object[] rowFilterValues)
          Internal: Applications should not use this method.
 void setRowValidation(boolean flag)
          Sets the validation flag on this iterator.
 
Methods inherited from class oracle.jbo.common.RowSetIteratorHelper
createKey, getFilteredRows, getFilteredRowsInRange
 
Methods inherited from class oracle.jbo.common.RowSetHelper
addManagementListener, fireMgmtIteratorClosed, fireMgmtIteratorReset, fireNavigationEvent, fireRangeRefreshed, fireRangeScrolled, fireRowDeleted, fireRowInserted, fireRowUpdated, getListeners, getListenersList, getManagementListenersList, getName, hasListeners, hasManagementListeners, removeListener, removeManagementListener, setName
 
Methods inherited from class oracle.jbo.common.PropertiesHelper
getProperty, refreshProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.RowSetIterator
addManagementListener, getName, removeManagementListener
 
Methods inherited from interface oracle.jbo.NavigatableRowIterator
removeListener
 

Field Detail

mViewRowSet

protected ViewRowSetImpl mViewRowSet

mViewSize

protected int mViewSize
Constructor Detail

ViewRowSetIteratorImpl

public ViewRowSetIteratorImpl(ViewRowSetImpl rowset)
Constructs a new secondary (non-default) view row set iterator.

Parameters:
rowset - the row set to which this iterator belongs.

ViewRowSetIteratorImpl

public ViewRowSetIteratorImpl(ViewRowSetImpl rowset,
                              java.lang.String name,
                              boolean isDefaultRSI)
Constructs a new view row set iterator.

Parameters:
name - the view row set iterator name.
isDefaultRSI - flag indicating whether this row set iterator is the default RSI for result.
Method Detail

getSyncLock

public final java.lang.Object getSyncLock()
Description copied from interface: RowSetIterator
Gets the locking object for this Row Set Iterator. Actually, this method locks the Application Module to which this Row Set Iterator belongs. See ApplicationModule.getSyncLock() for details.

Specified by:
getSyncLock in interface RowSetIterator
Returns:
the locking object.

isNameGenerated

public final boolean isNameGenerated()
Description copied from interface: RowSetIterator
Tests if the Iterator's name was generated by the system.

Specified by:
isNameGenerated in interface RowSetIterator
Returns:
true if the name was generated by the system. false if the name was given by the user and not generated by the system.

getViewObject

public ViewObject getViewObject()
Returns this row set iterator's view object.

Returns:
the ViewObject this row set iterator belongs to.

getRowSetImpl

public ViewRowSetImpl getRowSetImpl()
Returns this row set iterator's row set (implementation class).

This method differs from getRowSet in that the latter returns the RowSet interface, while this method returns the implementation class (ViewRowSetImpl).

Returns:
the ViewRowSetImpl this row set iterator belongs to.

getRowSet

public RowSet getRowSet()
Returns this row set iterator's row set (interface).

This method differs from getRowSetImpl in that the latter returns the implementation class (ViewRowSetImpl), while this method returns the RowSet interface.

Specified by:
getRowSet in interface RowSetIterator
Returns:
the RowSet this row set iterator belongs to.

isDefaultRSI

public boolean isDefaultRSI()
Internal: Applications should not use this method.

Indicates whether this row set iterator is the default RSI for the row set.

Returns:
indicates whether this row set iterator is the default RSI for the row set.

getRowSetIterator

public RowSetIterator getRowSetIterator()
Returns the row set iterator interface of this object.

Returns:
the row set interface of this object.

closeRowSetIterator

public void closeRowSetIterator()
Description copied from interface: RowSetIterator
Closes this row set iterator. If this row set iterator is a master in a master-detail relationship, closeRowSetIterator closes all detail row sets.

After that, it fires a RowSetManagementListener.iteratorClosed() event to its RowSetManagementListener's.

Then, it deregisters this row set iterator from the owning row set, and deregisters all its listeners.

Specified by:
closeRowSetIterator in interface RowSetIterator

getCliIteratorState

public SvcMsgIteratorState getCliIteratorState()
Specified by:
getCliIteratorState in interface WSRowSetIteratorMarshaller

getRowFilterValues

public java.lang.Object[] getRowFilterValues()
Specified by:
getRowFilterValues in interface WSRowSetIteratorMarshaller

prepareForBatchMode

public void prepareForBatchMode(SvcMsgIteratorState iteratorState,
                                boolean setCurrentRow)
Internal: Applications should not use this method.

Specified by:
prepareForBatchMode in interface WSRowSetIteratorMarshaller

prepareRangeForBatchMode

public void prepareRangeForBatchMode(boolean isExecuted,
                                     int currentRowIndex,
                                     int rangeStart,
                                     int rangeSize,
                                     boolean setCurrentRow)

setRowFilterValues

public void setRowFilterValues(java.lang.Object[] rowFilterValues)
Internal: Applications should not use this method.

Specified by:
setRowFilterValues in interface WSRowSetIteratorMarshaller

setRangeSize

public int setRangeSize(int newSize)
Sets the range size for the iterator.

See ViewObjectImpl.setRangeSize for details.

Specified by:
setRangeSize in interface RowIterator
Parameters:
newSize - the new range size.
Returns:
the new range size.
See Also:
ViewObjectImpl.setRangeSize(int)

getRangeSize

public int getRangeSize()
Returns the range size of the iterator.

See ViewObjectImpl.getRangeSize for details.

Specified by:
getRangeSize in interface RowIterator
Returns:
the range size.
See Also:
ViewObjectImpl.getRangeSize()

getFetchedRowCount

public int getFetchedRowCount()
Returns the number of rows fetched from the JDBC RestultSet.

Specified by:
getFetchedRowCount in interface RowIterator
Returns:
the number of rows fetched so far.

getRowCount

public int getRowCount()
Returns the total number of rows in this row set.

See ViewObjectImpl.getRowCount for details.

Specified by:
getRowCount in interface RowIterator
Returns:
the number of rows in the row set.
See Also:
ViewObjectImpl.getRowCount()

getRowCountInRange

public int getRowCountInRange()
Returns the actual number of rows in the range.

See ViewObjectImpl.getRowCountInRange for details.

Specified by:
getRowCountInRange in interface RowIterator
Returns:
the actual number of rows in the range.
See Also:
ViewObjectImpl.getRowCountInRange()

getRowAtRangeIndex

public Row getRowAtRangeIndex(int index)
Returns the row at range index index.

Range index is a 0 based index within the range.

Specified by:
getRowAtRangeIndex in interface RowIterator
Parameters:
index - range index of the row.
Returns:
the row at the specified range index. null if the index is outside the range, or if there is no row at the specified index.

getRowAtRangeIndexInternal

public Row getRowAtRangeIndexInternal(int index)
Internal: Applications should not use this method.

Returns the row at range index index.

Parameters:
index - range index of the row.
Returns:
the row at the specified range index. null if the index is outside the range, or if there is no row at the specified index.

getRow

public Row getRow(Key key)
Returns the first row whose key matches key.

See ViewObjectImpl.getRow for details.

Specified by:
getRow in interface RowIterator
Parameters:
key - key to match.
Returns:
the first matching row. null if no match.
See Also:
ViewObjectImpl.getRow(Key)

getRowFromHandle

public Row getRowFromHandle(java.lang.Object rowHandle)
Internal: Applications should not use this method.

Returns the row with a handle specified by hdl.

See ViewObjectImpl.getRowFromHandle for details.

Parameters:
rowHandle - the row handle.
Returns:
the row identified by the row handle.
See Also:
ViewObjectImpl.getRowFromHandle(Object)

removeRowHandle

public void removeRowHandle(java.lang.Object rowHandle)
Internal: Applications should not use this method.

Removes the row handle from the row handle hash table.

See ViewObjectImpl.removeRowHandle for details.

Parameters:
rowHandle - the row handle to remove.
See Also:
ViewObjectImpl.removeRowHandle(Object)

createKey

public Key createKey(AttributeList nvp)
Description copied from interface: RowIterator
Given a list of name-value pairs, creates a Key object that matches the key structure for the ViewObject for this RowItertor. This Key object could be used as a valid argument to findByKey. This Key will have null values for attributes expected in the key structure for this ViewObject, but not found in the given set of name-value pairs.

Specified by:
createKey in interface RowIterator

findByKey

public Row[] findByKey(Key key,
                       int maxNumOfRows)
Finds and returns view rows that match the specified key.

See ViewObjectImpl.findByKey for details.

Specified by:
findByKey in interface RowIterator
Parameters:
key - the key to match.
maxNumOfRows - the maximum size of the array to return, or -1 to return all rows.
Returns:
an array of rows matching the key.
See Also:
ViewObjectImpl.findByKey(Key, int)

findAndSetCurrentRowByKey

public void findAndSetCurrentRowByKey(Key key,
                                      int rangeIndex)
Specified by:
findAndSetCurrentRowByKey in interface WSRowSetIteratorMarshaller

findByKey

public Row[] findByKey(Key key,
                       int maxNumOfRows,
                       boolean skipWhere)

getCurrentRow

public Row getCurrentRow()
Returns the current row of the iterator.

See ViewObjectImpl.getCurrentRow for details.

Specified by:
getCurrentRow in interface RowIterator
Returns:
the current row. null if no current row.
See Also:
ViewObjectImpl.getCurrentRow()

getCurrentRowSlot

public int getCurrentRowSlot()
Returns the current row slot status.

See ViewObjectImpl.getCurrentRowSlot for details.

Specified by:
getCurrentRowSlot in interface RowIterator
Returns:
one of the slot status constants listed above.
See Also:
ViewObjectImpl.getCurrentRowSlot()

getIterMode

public int getIterMode()
Description copied from interface: RowIterator
Gets the current iteration mode. See Iteration Modes above for details on iteration mode which controls how the range behaves when it reaches the end of the Row Set.

Specified by:
getIterMode in interface RowIterator
Returns:
ITER_MODE_LAST_PAGE_PARTIAL if the iteration mode is "partial-last-page", ITER_MODE_LAST_PAGE_FULL if it is "full-last-page".

setIterMode

public void setIterMode(int mode)
Description copied from interface: RowIterator
Sets the iteration mode for this Row Iterator. See Iteration Modes above for details on iteration mode which controls how the range behaves when it reaches the end of the Row Set.

Specified by:
setIterMode in interface RowIterator
Parameters:
mode - should be ITER_MODE_LAST_PAGE_PARTIAL if the iteration mode is to be "partial-last-page", ITER_MODE_LAST_PAGE_FULL if it is to be "full-last-page".

setRowValidation

public void setRowValidation(boolean flag)
Description copied from interface: RowIterator
Sets the validation flag on this iterator. By default a RowIterator validates the current row when navigating to another row. This method can be used to turn this row-validation off by passing 'false' as parameter.

Specified by:
setRowValidation in interface RowIterator
Parameters:
flag - Whether to turn row validation off or not.

isRowValidation

public boolean isRowValidation()
Description copied from interface: RowIterator
Gets the validation flag on this iterator. By default a RowIterator validates the current row when navigating to another row. This method returns TRUE if this row-validation is turned off.

Specified by:
isRowValidation in interface RowIterator

setCurrentRow

public boolean setCurrentRow(Row row)
Indicates whether the cursor has been successfully moved to the row specified by row.

See ViewObjectImpl.setCurrentRow for details.

Specified by:
setCurrentRow in interface RowIterator
Parameters:
row - the row to which the cursor should be moved.
Returns:
indicates whether the current row was successfully set or not.
See Also:
ViewObjectImpl.setCurrentRow(Row)

setCurrentRowAtRangeIndex

public boolean setCurrentRowAtRangeIndex(int index)
Moves the iterator to the row whose range index is index.

See ViewObjectImpl.setCurrentRowAtRangeIndex for details.

Specified by:
setCurrentRowAtRangeIndex in interface RowIterator
Parameters:
index - range index to which to move the current row.
Returns:
indicates whether the current row was successfully set or not.
See Also:
ViewObjectImpl.setCurrentRowAtRangeIndex(int)

getCurrentRowIndex

public int getCurrentRowIndex()
Returns the absolute row index of the current row in the row set.

See ViewObjectImpl.getCurrentRowIndex for details.

Specified by:
getCurrentRowIndex in interface RowIterator
Returns:
the absolute row index of the current row. -1 if the row set has not be executed, or the iterator has just been reset.
See Also:
ViewObjectImpl.getCurrentRowIndex()

getRangeIndexOf

public int getRangeIndexOf(Row row)
Returns the range index of the row specified by row.

See ViewObjectImpl.getRangeIndexOf for details.

Specified by:
getRangeIndexOf in interface RowIterator
Parameters:
row - the row in question.
Returns:
the range index of the row. -1 if the row is not within the range.
See Also:
ViewObjectImpl.getRangeIndexOf(Row)

getEstimatedRangePageCount

public int getEstimatedRangePageCount()
Description copied from interface: RowSetIterator
Returns getEstimatedRowCount()/rangePageSize, if rangeSize > 0. For rangeSize <= 0, returns 1.

This number may fluxuate when the View Object is syncronized with its Entity Object.

Specified by:
getEstimatedRangePageCount in interface RowSetIterator
Returns:
the number of range-pages that this RowSet collection has.

scrollToRangePage

public int scrollToRangePage(int pageIndex)
Description copied from interface: RowSetIterator
Moves the row set range start to the given page index where every page consists of RangeSize number of rows. PageIndex should start at page number 1. This method calculates the rowIndex that should start at that page and then scrolls the iterator to start at that row by using the following calculation:

(rangeSize * (pageSize-1)) - getRangeStart();

Specified by:
scrollToRangePage in interface RowSetIterator
Parameters:
pageIndex - the page number to go to in the result set.
Returns:
the number of rows actually scrolled.

scrollRange

public int scrollRange(int rows)
Scrolls the range by amount.

See ViewObjectImpl.scrollRange for details.

Specified by:
scrollRange in interface RowIterator
Parameters:
rows - the number of rows to scroll.
Returns:
the actual number of rows scrolled. A negative number indicates that the scroll was scrolled upward.
See Also:
ViewObjectImpl.scrollRange(int)

scrollRangeTo

public int scrollRangeTo(Row row,
                         int index)
Scrolls the range to a specific row.

See ViewObjectImpl.scrollRangeTo for details.

Specified by:
scrollRangeTo in interface RowIterator
Parameters:
row - the row to scroll the range to.
index - the range index to position the row at.
Returns:
the actual number of rows scrolled. A negative number indicates that the scroll was scrolled upward.
See Also:
ViewObjectImpl.scrollRangeTo(Row, int)

reset

public void reset()
Resets the iterator.

See ViewObjectImpl.reset for details.

Specified by:
reset in interface RowIterator
See Also:
ViewObjectImpl.reset()

first

public Row first()
Navigates to the first row in the row set.

See ViewObjectImpl.first for details.

Specified by:
first in interface RowIterator
Returns:
the first row, which becomes the current row for the iterator. null if the row set has no rows.
See Also:
ViewObjectImpl.first()

last

public Row last()
Navigates to the last row in the row set.

See ViewObjectImpl.last for details.

Specified by:
last in interface RowIterator
Returns:
the last row, which becomes the current row for the iterator. null if the row set has no rows.
See Also:
ViewObjectImpl.last()

next

public Row next()
Navigates to the next row in the row set.

See ViewObjectImpl.next for details.

Specified by:
next in interface RowIterator
Returns:
the next row, which becomes the current row for the iterator. null if no next row. If no next row, the current row is not moved.
See Also:
ViewObjectImpl.next()

previous

public Row previous()
Navigates to the previous row in the row set.

See ViewObjectImpl.previous for details.

Specified by:
previous in interface RowIterator
Returns:
the previous row, which becomes the current row for the iterator. null if no previous row. If no previous row, the current row is not moved.
See Also:
ViewObjectImpl.previous()

hasNext

public boolean hasNext()
Indicates whether the iterator has a next row or not.

See ViewObjectImpl.hasNext for details.

Specified by:
hasNext in interface RowIterator
Returns:
true if there is a next row, false if not.
See Also:
ViewObjectImpl.hasNext()

hasPrevious

public boolean hasPrevious()
Indicates whether the iterator has a previous row or not.

See ViewObjectImpl.hasPrevious for details.

Specified by:
hasPrevious in interface RowIterator
Returns:
true if there is a previous row, false if not.
See Also:
ViewObjectImpl.hasPrevious()

isRangeAtBottom

public boolean isRangeAtBottom()
Indicates whether the iterator range contains the last row of the row set.

See ViewObjectImpl.isRangeAtBottom for details.

Specified by:
isRangeAtBottom in interface RowIterator
Returns:
true if the range contains the last row, false if not.
See Also:
ViewObjectImpl.isRangeAtBottom()

isRangeAtTop

public boolean isRangeAtTop()
Indicates whether the iterator range contains the first row of the row set.

See ViewObjectImpl.isRangeAtTop for details.

Specified by:
isRangeAtTop in interface RowIterator
Returns:
true if the range contains the first row, false if not.
See Also:
ViewObjectImpl.isRangeAtTop()

nextIndex

public int nextIndex()
Returns the absolute row index of the next row.

Returns:
the absolute row index of the next row. -1 if there is no next row.

previousIndex

public int previousIndex()
Returns the absolute row index of the previous row.

Returns:
the absolute row index of the previous row. -1 if there is no previous row.

getAllRowsInRangeInternal

public Row[] getAllRowsInRangeInternal(boolean shouldEnsureRefreshed)

getAllRowsInRange

public Row[] getAllRowsInRange()
Returns an array of all rows in the iterator's range.

See ViewObjectImpl.getAllRowsInRange for details.

Specified by:
getAllRowsInRange in interface RowIterator
Returns:
an array of view rows.
See Also:
ViewObjectImpl.getAllRowsInRange()

getNextRangeSet

public Row[] getNextRangeSet()
Description copied from interface: RowSetIterator
Gets the next set of rows in the range. This method is good for processing rows in a range-ful fashion. Suppose the Row Set has 20 rows and the Iterator range size is 10. Suppose further that the Iterator is showing rows 0 through 9 (0-based indexing). Calling getNextRangeSet() will return rows 10 through 19.

If the next range set does not have enough rows to fill up the range, getNextRangeSet() returns a partially filled range. That is, this method operates as if the iteration mode is RowIterator.ITER_MODE_LAST_PAGE_PARTIAL.

If there is no more rows, this method returns an empty array (an array of length 0).

While obtaining the next range set, the range will be scrolled. This causes a #oracle.jbo.ScrollEvent to be sent to #oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the #oracle.jbo.RowSetListener interface. Further, this listener must be registered through a call to #oracle.jbo.NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

After the next range set is obtained, the method sets the first Row of the range as the current row. This may fire a #oracle.jbo.NavigationEvent and sends it to #oracle.jbo.RowSetListener.navigated(oracle.jbo.NavigationEvent).

Specified by:
getNextRangeSet in interface RowSetIterator
Returns:
an array of Rows in the next range set. An array of length 0 if there are no more rows.

getNextRangeSetWithAdjustment

public Row[] getNextRangeSetWithAdjustment(int rangeAdjust)

getPreviousRangeSet

public Row[] getPreviousRangeSet()
Description copied from interface: RowSetIterator
Gets the previous set of rows in the range. This method is good for processing rows in a range-ful fashion. Suppose the Row Set has 20 rows and the Iterator range size is 10. Suppose further that the Iterator is showing rows 10 through 19 (0-based indexing). Calling getPreviousRangeSet() will return rows 0 through 9.

If there is no more rows, this method returns an empty array (an array of length 0).

While obtaining the previous range set, the range will be scrolled. This causes a #oracle.jbo.ScrollEvent to be sent to #oracle.jbo.RowSetListener.rangeScrolled(oracle.jbo.ScrollEvent). To pick up such an event, the listener object must implement the #oracle.jbo.RowSetListener interface. Further, this listener must be registered through a call to #oracle.jbo.NavigatableRowIterator.addListener(Object) (the listener object passed in as the parameter to addListener).

After the previous range set is obtained, the method sets the first Row of the range as the current row. This may fire a #oracle.jbo.NavigationEvent and sends it to #oracle.jbo.RowSetListener.navigated(oracle.jbo.NavigationEvent).

Specified by:
getPreviousRangeSet in interface RowSetIterator
Returns:
an array of Rows in the previous range set. An array of length 0 if there are no more rows.

enumerateRowsInRange

public java.util.Enumeration enumerateRowsInRange()
Creates and returns an enumerator of the rows in the range.

Specified by:
enumerateRowsInRange in interface RowIterator
Returns:
an enumerator.

createAndInitRow

public Row createAndInitRow(AttributeList initVals)
Description copied from interface: RowIterator
Creates and initializes a new Row object, but does not insert it into the Row Set. This method differs from createRow() mainly in that this method allows the user to pass in a list of name-value pairs with which row attributes are initialized.

nvp is a named value pair. When building an nvp from scratch, use NameValuePairs to build a new nvp. Here is an example:

    NameValuePairs nvp = new NameValuePairs();
    nvp.setAttribute("EmpTyp", "C");

    Row row = voEmp.createAndInitRow(nvp);
 
This method is particularly useful when creating a subclass View Row or Entity Row. You can include polymorphic discriminator attribute values in nvp and correct subclass row object will be created.

When this method is called, underlying entities are created. After the new entities are created, a new view row is created. After that ViewRowImpl.create(oracle.jbo.AttributeList) is called with this nvp. ViewRowImpl.create(AttributeList) walks thru the list of entities and calls EntityImpl.create(AttributeList) with the same nvp for each entity in the view row.

Specified by:
createAndInitRow in interface RowIterator
Parameters:
initVals - a list of name-value pairs.
Returns:
a new Row object.

createRow

public Row createRow()
Creates a new view row.

See ViewObjectImpl.createRow for details.

Specified by:
createRow in interface RowIterator
Returns:
the new view row.
See Also:
ViewObjectImpl.createRow()

insertRow

public void insertRow(Row row)
Inserts the row into the row set.

See ViewObjectImpl.insertRow for details.

Specified by:
insertRow in interface RowIterator
Parameters:
row - the view row to insert.
See Also:
ViewObjectImpl.insertRow(Row)

doInsertRow

public void doInsertRow(Row row,
                        boolean navigateToRow)
INTERNAL: Applications should not use this method.


insertRowAtRangeIndex

public void insertRowAtRangeIndex(int index,
                                  Row row)
Inserts the row into the row set at the specified range index.

See ViewObjectImpl.insertRowAtRangeIndex for details.

Specified by:
insertRowAtRangeIndex in interface RowIterator
Parameters:
index - the range index into which the row is to be inserted.
row - the view row to insert.
See Also:
ViewObjectImpl.insertRowAtRangeIndex(int, Row)

removeCurrentRow

public void removeCurrentRow()
Removes the current row.

See ViewObjectImpl.removeCurrentRow for details.

Specified by:
removeCurrentRow in interface RowIterator
See Also:
ViewObjectImpl.removeCurrentRow()

removeCurrentRowFromCollection

public void removeCurrentRowFromCollection()
Description copied from interface: RowIterator
Removes the current Row object from the collection.

It does not cause the row to be deleted from the database table. It just removes the row from the row collection. However, once the row is removed, it cannot be used any more. If you want to remove the current row from collection and insert it elsewhere, call #removeAndRetain(), change currency to the desired location, and then call RowIterator.insertRow(oracle.jbo.Row) with that row.

Specified by:
removeCurrentRowFromCollection in interface RowIterator

removeCurrentRowAndRetain

public Row removeCurrentRowAndRetain()
Description copied from interface: RowIterator
Removes the current Row object from the collection and retain it for insertion into another location.

It does not cause the row to be deleted from the database table. It just removes the row from the row collection.

This method differs from RowIterator.removeCurrentRowFromCollection() in that after the current row is removed from the collection, it can be inserted back into the collection at another location.

To do so, call RowIterator.removeCurrentRowAndRetain(), and get the returning row. Then, change currency to the desired location, and call RowIterator.insertRow(oracle.jbo.Row) with that row.

Specified by:
removeCurrentRowAndRetain in interface RowIterator
Returns:
the current row which was just removed from collection.

removeRowAtRangeIndex

public void removeRowAtRangeIndex(int index)
Removes a view row at range index index.

Parameters:
index - range index of the row to remove.

createDetailRowSet

public RowSet createDetailRowSet(java.lang.String rsName,
                                 java.lang.String linkDefName)
Creates a detail Row Set. See getDetailRowSets() for explanation of detail Row Sets.

This method creates a new detail Row Set for this Iterator.

Specified by:
createDetailRowSet in interface RowSetIterator
Parameters:
rsName - the name of the new detail Row Set.
linkDefName - the name of a View Link definition. This View Link chooses the relationship in which this Iterator is the master and the new Row Set is the detail. It must be a fully qualified name (including the package name).
Returns:
the new detail Row Set.

addDetailViewRowSet

protected void addDetailViewRowSet(RowSet detailRowSet)
##INTERNAL##

Adds the detail row set to the list of detail row sets.

This row set iterator is the master and detailRowSet is a detail.

Parameters:
detailRowSet - the detail row set to add.

removeDetailViewRowSet

protected void removeDetailViewRowSet(RowSet detailRowSet)
##INTERNAL##

Removes the detail row set from the list of detail row sets.

This row set iterator is the master and detailRowSet is a detail.

Parameters:
detailRowSet - the detail row set to remove.

getDetailRowSets

public RowSet[] getDetailRowSets()
Gets an array of detail Row Sets for which this Iterator is the master.

In a master-detail relationship in an Application Module, the master in reality is a Row Set Iterator. (Though we often speak of master View Object, in reality, it is the Iterator behind the View Object which is playing the role of the master). Whenever the currency of this master Iterator moves, the detail Row Sets are re-executed to show related Rows.

Calling this method returns an array of Row Sets that are related to this Iterator as detail Row Sets.

Specified by:
getDetailRowSets in interface RowSetIterator
Returns:
an array of detail RowSet.

getRangeStart

public int getRangeStart()
Returns the absolute row index of the first row in the range.

See ViewObjectImpl.getRangeStart for details.

Specified by:
getRangeStart in interface RowIterator
Returns:
the absolute row index of the first row in the range.
See Also:
ViewObjectImpl.getRangeStart()

setRangeStart

public int setRangeStart(int start)
Sets the range position by the absolute row index specified in start.

See ViewObjectImpl.setRangeStart for details.

Specified by:
setRangeStart in interface RowIterator
Parameters:
start - absolute row index of the row that should be positioned as the first row of the range. An absolute row index is a row index in the entire row set. It starts at 0.
Returns:
the absolute row index of the first row of the range.
See Also:
ViewObjectImpl.setRangeStart(int)

isRefreshed

public boolean isRefreshed()
INTERNAL: Applications should not use this method.


refresh

protected void refresh(boolean resetIter,
                       boolean fillUpRange)

getProperties

public java.util.Hashtable getProperties()
Retrieves all properties. It is a union of properties on this view object and those on the view definition.

Specified by:
getProperties in interface Properties
Specified by:
getProperties in class PropertiesHelper
Returns:
hash table (name-value pairs) of all properties.

addListener

public void addListener(java.lang.Object listener)
Adds an event listener to this object.

listener should implement the RowSetListener interface.

Specified by:
addListener in interface NavigatableRowIterator
Overrides:
addListener in class RowSetHelper
Parameters:
listener - the RowSetListener registering interest in this object's events.

fireRowUpdated

public void fireRowUpdated(int rowIndex,
                           Row row,
                           int[] attrIndices)
Fires the row updated event to its listeners.


findRSIForEntity

public static RowSetIterator findRSIForEntity(RowSetIterator[] rsis,
                                              Row eRow)

findByEntity

public Row[] findByEntity(int eRowHandle,
                          int maxNumOfRows)
Description copied from interface: RowIterator
Finds and returns View rows that use the Entity row, identified by the Entity row handle, eRowHandle.

Specified by:
findByEntity in interface RowIterator
Parameters:
eRowHandle - the Entity row handle.
maxNumOfRows - the maximum size of the row array to return, or -1 to return all rows.
Returns:
an array of View rows that use the Entity row.

activateIteratorState

public final void activateIteratorState(Element node,
                                        boolean clearIteratorState)

getFilteredRows

public Row[] getFilteredRows(RowQualifier qualifier)

getFilteredRowsInRange

public Row[] getFilteredRowsInRange(RowQualifier qualifier)

getFilteredRows

public Row[] getFilteredRows(java.lang.String attrName,
                             java.lang.Object attrValue)
Description copied from interface: RowSetIterator
Returns all rows in this collection whose attribute value matches the value being passed in attrValue.

Note that this method does not affect the current RowSetIterator.

Specified by:
getFilteredRows in interface RowSetIterator
Parameters:
attrName - name of the attribute to be used for filtering.
attrValue - attribute value for filtering.
Returns:
an array of rows that match.

getFilteredRowsInRange

public Row[] getFilteredRowsInRange(java.lang.String attrName,
                                    java.lang.Object attrValue)
Description copied from interface: RowSetIterator
Returns all rows in this range whose attribute value matches the value being passed in attrValue.

This method uses getAllRowsInRange() to retrieve all rows and then match the rows.

Specified by:
getFilteredRowsInRange in interface RowSetIterator
Parameters:
attrName - name of the attribute to be used for filtering.
attrValue - attribute value for filtering.
Returns:
an array of rows in the current range that match.

Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

 

Copyright © 1997, 2004, Oracle. All rights reserved.