private static class PlotServlet.CFResultIterator extends java.lang.Object implements SqlResultIterator
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
Modifier and Type | Field and Description |
---|---|
private SqlResultIterator |
child |
private PlotServlet.CFSqlResult |
next |
private SqlResultIterator |
parent |
Constructor and Description |
---|
PlotServlet.CFResultIterator(SqlResultIterator parent,
SqlResultIterator child) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the iterator and immediately release all resources
associated with it.
|
int |
getIndex(java.lang.String name)
Get the index number of a selected column.
|
long |
getTotalCount()
Get the total number of items returned by the query, ignoring
any limits set by
Query.setFirstResult(int) and
Query.setMaxResults(int) . |
boolean |
hasNext() |
boolean |
isClosed()
Check if the iterator has been closed.
|
SqlResult |
next() |
void |
remove()
Not supported.
|
private final SqlResultIterator parent
private final SqlResultIterator child
private final PlotServlet.CFSqlResult next
PlotServlet.CFResultIterator(SqlResultIterator parent, SqlResultIterator child)
public boolean hasNext()
hasNext
in interface java.util.Iterator<SqlResult>
public void remove()
remove
in interface java.util.Iterator<SqlResult>
java.lang.UnsupportedOperationException
- Alwayspublic long getTotalCount()
QueryResult
Query.setFirstResult(int)
and
Query.setMaxResults(int)
. If the
Query.setReturnTotalCount(boolean)
hasn't been enabled this method may
not return a correct value.getTotalCount
in interface QueryResult
Query.setReturnTotalCount(boolean)
public void close()
ResultIterator
close
in interface ResultIterator<SqlResult>
public boolean isClosed()
ResultIterator
isClosed
in interface ResultIterator<SqlResult>
public int getIndex(java.lang.String name) throws java.sql.SQLException
SqlResultIterator
SqlResult.getXxx(index)
methods to get the value of that column.getIndex
in interface SqlResultIterator
name
- The name of a selected columnjava.sql.SQLException
- If there is an error