|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.FutureTense.Util.IListWrapper
COM.FutureTense.Util.IterableIListWrapper
public class IterableIListWrapper
This class provides a lightweight wrapper over an IList object for the
purpose of adding Iterable
functionality to the IList.
iterator()
method of this class returns an iterator which
exposes only a single row of the wrapped list for each call to the next()
method. Attempting to mutate or clone the row view during iteration will
result in an UnsupportedOperationException
being thrown.
Typical usage of this class will likely resemble the following:
IList manyRows = ics.SQL(...);
for (IList row : new IterableIListWrapper(manyRows))
{
String idCol = row.getValue("id");
String nameCol = row.getValue("name");
String valueCol = row.getValue("value");
String commentCol = row.getValue("comment");
...
}
Note that the "rows" returned by the iterator are themselves IList objects.
This way the data retrieval api is familiar to IList users - it's the same
as with a non-iterable IList, except the iteration code is handled by Java
instead of the developer.
Field Summary |
---|
Fields inherited from interface COM.FutureTense.Interfaces.IList |
---|
first, gotorow, last, next, prev |
Constructor Summary | |
---|---|
IterableIListWrapper(IList list)
|
Method Summary | |
---|---|
java.util.Iterator<IList> |
iterator()
Return an Iterator over the IList. |
Methods inherited from class COM.FutureTense.Util.IListWrapper |
---|
atEnd, clone, currentRow, flush, getColumnName, getFileData, getFileString, getIndirectColumnName, getName, getObject, getValue, hasData, moveTo, moveToRow, numColumns, numIndirectColumns, numRows, rename, stringInList |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface COM.FutureTense.Interfaces.IList |
---|
atEnd, clone, currentRow, flush, getColumnName, getFileData, getFileString, getIndirectColumnName, getName, getObject, getValue, hasData, moveTo, moveToRow, numColumns, numIndirectColumns, numRows, rename, stringInList |
Constructor Detail |
---|
public IterableIListWrapper(IList list)
Method Detail |
---|
public java.util.Iterator<IList> iterator()
next()
method, but these ILists have their rows
locked to the current row. Attempts to move to another row, rename, flush,
or clone the returned IList will result in an UnsupportedOperationException
being thrown.
iterator
in interface java.lang.Iterable<IList>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |