Class PlotServlet.CFResultIterator
java.lang.Object
net.sf.basedb.clients.web.servlet.PlotServlet.CFResultIterator
- All Implemented Interfaces:
AutoCloseable
,Iterator<SqlResult>
,QueryResult
,ResultIterator<SqlResult>
,SqlResultIterator
- Enclosing class:
- PlotServlet
Special implementation of a
SqlResultIterator
that combines the result from the parent and child into
one virtual iterator. The parent iterator must select
the following columns in this order: postion, parent M, parent A.
The child iterator must selected the following columns in this order:
position, child M.
The we map our own columns like this: a --> parent A, m --> parent M, cf --> parent M - child M
-
Field Summary
Modifier and TypeFieldDescriptionprivate final SqlResultIterator
private final PlotServlet.CFSqlResult
private final SqlResultIterator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the iterator and immediately release all resources associated with it.int
Get the index number of a selected column.long
Get the total number of items returned by the query, ignoring any limits set byQuery.setFirstResult(int)
andQuery.setMaxResults(int)
.boolean
hasNext()
boolean
isClosed()
Check if the iterator has been closed.next()
void
remove()
Not supported.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
parent
-
child
-
next
-
-
Constructor Details
-
CFResultIterator
CFResultIterator(SqlResultIterator parent, SqlResultIterator child)
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()Not supported.- Specified by:
remove
in interfaceIterator<SqlResult>
- Throws:
UnsupportedOperationException
- Always
-
getTotalCount
public long getTotalCount()Description copied from interface:QueryResult
Get the total number of items returned by the query, ignoring any limits set byQuery.setFirstResult(int)
andQuery.setMaxResults(int)
. If theQuery.setReturnTotalCount(boolean)
hasn't been enabled this method may not return a correct value.- Specified by:
getTotalCount
in interfaceQueryResult
- Returns:
- The total number of items, or -1 if not known
- See Also:
-
close
public void close()Description copied from interface:ResultIterator
Close the iterator and immediately release all resources associated with it.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceResultIterator<SqlResult>
-
isClosed
public boolean isClosed()Description copied from interface:ResultIterator
Check if the iterator has been closed.- Specified by:
isClosed
in interfaceResultIterator<SqlResult>
-
getIndex
Description copied from interface:SqlResultIterator
Get the index number of a selected column. Use this method to find the index of a column and then use theSqlResult.getXxx(index)
methods to get the value of that column.- Specified by:
getIndex
in interfaceSqlResultIterator
- Parameters:
name
- The name of a selected column- Returns:
- The index number
- Throws:
SQLException
- If there is an error
-