| |
|
| java.lang.Object org.apache.ojb.broker.accesslayer.ChainingIterator
ChainingIterator | public class ChainingIterator implements OJBIterator(Code) | | author: matthew.baird (mattbaird@yahoo.com) author: The ChainingIterator is an extent aware Iterator. author: How the ChainingIterator works: author: The ChainedIterator holds a collection of RsIterators for each queried author: Interface-based extent. author: The RsIterator is able to load objects that are non-interface extents, author: mapped to the same table. author: The ChainingIterator cannot return sorted results as the iterator is a author: collection of query results across different tables. version: $Id: ChainingIterator.java,v 1.13.2.2 2005/12/21 22:22:58 tomdz Exp $ |
Method Summary | |
public boolean | absolute(int row) the absolute and relative calls are the trickiest parts. | public void | addIterator(OJBIterator iterator) use this method to construct the ChainingIterator
iterator by iterator. | public boolean | containsIteratorForTable(String aTable) | public void | disableLifeCycleEvents() | public int | fullSize() | public boolean | hasNext() check the list of iterators to see if we have a next element. | public Object | next() first checks to make sure we aren't at the end of the list of
iterators, positions the cursor appropriately, then retrieves
next object in active iterator. | public boolean | relative(int row) Moves the cursor a relative number of rows. | public void | releaseDbResources() delegate to each contained OJBIterator and release
its resources. | public void | remove() | public int | size() Calculates the size of all the iterators. |
ChainingIterator | public ChainingIterator()(Code) | | Constructor for ChainingIterator.
|
ChainingIterator | public ChainingIterator(List iterators)(Code) | | Constructor for ChainingIterator.
|
absolute | public boolean absolute(int row) throws PersistenceBrokerException(Code) | | the absolute and relative calls are the trickiest parts. We have to
move across cursor boundaries potentially.
a + row value indexes from beginning of resultset
a - row value indexes from the end of th resulset.
Calling absolute(1) is the same as calling first().
Calling absolute(-1) is the same as calling last().
|
addIterator | public void addIterator(OJBIterator iterator)(Code) | | use this method to construct the ChainingIterator
iterator by iterator.
|
containsIteratorForTable | public boolean containsIteratorForTable(String aTable)(Code) | | Answer true if an Iterator for a Table is already available
Parameters: aTable - |
hasNext | public boolean hasNext()(Code) | | check the list of iterators to see if we have a next element.
true if one of the contained iterators past the currentposition has a next. |
next | public Object next()(Code) | | first checks to make sure we aren't at the end of the list of
iterators, positions the cursor appropriately, then retrieves
next object in active iterator.
the next object in the iterator. |
relative | public boolean relative(int row) throws PersistenceBrokerException(Code) | | Moves the cursor a relative number of rows.
Movement can go in forward (positive) or reverse (negative).
Calling relative does not "wrap" meaning if you move before first or
after last you get positioned at the first or last row.
Calling relative(0) does not change the cursor position.
Note: Calling the method relative(1) is different from calling
the method next() because is makes sense to call next() when
there is no current row, for example, when the cursor is
positioned before the first row or after the last row of
the result set.
|
releaseDbResources | public void releaseDbResources()(Code) | | delegate to each contained OJBIterator and release
its resources.
|
remove | public void remove()(Code) | | |
size | public int size() throws PersistenceBrokerException(Code) | | Calculates the size of all the iterators. Caches it for fast
lookups in the future. iterators shouldn't change size after the
queries have been executed so caching is safe (assumption, should check).
the combined size of all the iterators for all extents. |
|
|
|