|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.context.RowIterator
public class RowIterator
This class is a context wrapper for ResultSets, and provides an iteration mecanism for #foreach loops, as long as getters for values of the current row.
| Field Summary | |
|---|---|
protected Pooled |
pooledStatement
the statement |
protected Entity |
resultEntity
the resulting entity |
protected java.sql.ResultSet |
resultSet
the result set |
protected UserContext |
userContext
user context |
| Constructor Summary | |
|---|---|
RowIterator(Pooled pooledStatement,
java.sql.ResultSet resultSet,
Entity resultEntity)
Build a new RowIterator |
|
| Method Summary | |
|---|---|
protected boolean |
dataAvailable()
check if some data is available |
java.lang.Object |
get(java.lang.Object key)
generic getter for values of the current row. |
java.util.List |
getRows()
gets all the rows in a list of maps |
boolean |
hasNext()
Returns true if the iteration has more elements. |
java.util.Set |
keySet()
|
java.lang.Object |
next()
Returns the next element in the iteration. |
void |
remove()
not implemented. |
void |
setUserContext(UserContext context)
set the localizer to be used to build instances |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Pooled pooledStatement
protected java.sql.ResultSet resultSet
protected Entity resultEntity
protected UserContext userContext
| Constructor Detail |
|---|
public RowIterator(Pooled pooledStatement,
java.sql.ResultSet resultSet,
Entity resultEntity)
pooledStatement - the sql statementresultSet - the resultsetresultEntity - the resulting entity (may be null)| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iteratortrue if the iterator has more elements.public java.lang.Object next()
next in interface java.util.Iteratorpublic void remove()
remove in interface java.util.Iteratorpublic java.lang.Object get(java.lang.Object key)
get in interface ReadOnlyMapkey - the name of an existing column or attribute
public java.util.List getRows()
public java.util.Set keySet()
keySet in interface ReadOnlyMap
protected boolean dataAvailable()
throws java.sql.SQLException
true if some data is available (ie the internal
ResultSet is not empty, and not before first row neither after last
one)
java.sql.SQLException - if the internal ResultSet is not happypublic void setUserContext(UserContext context)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||