|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ofbiz.entity.util.EntityListIterator
public class EntityListIterator
Generic Entity Cursor List Iterator for Handling Cursored DB Results
Field Summary | |
---|---|
protected boolean |
closed
|
protected GenericDelegator |
delegator
|
protected boolean |
haveMadeValue
|
protected ModelEntity |
modelEntity
|
protected ModelFieldTypeReader |
modelFieldTypeReader
|
static java.lang.String |
module
Module Name Used for debugging |
protected java.sql.ResultSet |
resultSet
|
protected java.util.List<ModelField> |
selectFields
|
protected SQLProcessor |
sqlp
|
Constructor Summary | |
---|---|
EntityListIterator(java.sql.ResultSet resultSet,
ModelEntity modelEntity,
java.util.List<ModelField> selectFields,
ModelFieldTypeReader modelFieldTypeReader)
|
|
EntityListIterator(SQLProcessor sqlp,
ModelEntity modelEntity,
java.util.List<ModelField> selectFields,
ModelFieldTypeReader modelFieldTypeReader)
|
Method Summary | |
---|---|
boolean |
absolute(int rowNum)
performs the same function as the ResultSet.absolute method; if rowNum is positive, goes to that position relative to the beginning of the list; if rowNum is negative, goes to that position relative to the end of the list; a rowNum of 1 is the same as first(); a rowNum of -1 is the same as last() |
void |
add(GenericValue obj)
|
void |
afterLast()
Sets the cursor position to just after the last result so that previous() will return the last result |
void |
beforeFirst()
Sets the cursor position to just before the first result so that next() will return the first result |
void |
close()
|
GenericValue |
currentGenericValue()
NOTE: Calling this method does return the current value, but so does calling next() or previous(), so calling one of those AND this method will cause the value to be created twice |
int |
currentIndex()
|
protected void |
finalize()
|
boolean |
first()
Sets the cursor position to last result; if result set is empty returns false |
java.util.List<GenericValue> |
getCompleteList()
|
java.util.List<GenericValue> |
getPartialList(int start,
int number)
Gets a partial list of results starting at start and containing at most number elements. |
int |
getResultsSizeAfterPartialList()
|
boolean |
hasNext()
PLEASE NOTE: Because of the nature of the JDBC ResultSet interface this method can be very inefficient; it is much better to just use next() until it returns null For example, you could use the following to iterate through the results in an EntityListIterator: GenericValue nextValue = null; while ((nextValue = (GenericValue) this.next()) != null) { ... |
boolean |
hasPrevious()
PLEASE NOTE: Because of the nature of the JDBC ResultSet interface this method can be very inefficient; it is much better to just use previous() until it returns null |
boolean |
last()
Sets the cursor position to last result; if result set is empty returns false |
GenericValue |
next()
Moves the cursor to the next position and returns the GenericValue object for that position; if there is no next, returns null For example, you could use the following to iterate through the results in an EntityListIterator: GenericValue nextValue = null; while ((nextValue = (GenericValue) this.next()) != null) { ... |
int |
nextIndex()
Returns the index of the next result, but does not guarantee that there will be a next result |
GenericValue |
previous()
Moves the cursor to the previous position and returns the GenericValue object for that position; if there is no previous, returns null |
int |
previousIndex()
Returns the index of the previous result, but does not guarantee that there will be a previous result |
boolean |
relative(int rows)
performs the same function as the ResultSet.relative method; if rows is positive, goes forward relative to the current position; if rows is negative, goes backward relative to the current position; |
void |
remove()
|
void |
set(GenericValue obj)
|
void |
setDelegator(GenericDelegator delegator)
|
void |
setFetchSize(int rows)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String module
protected SQLProcessor sqlp
protected java.sql.ResultSet resultSet
protected ModelEntity modelEntity
protected java.util.List<ModelField> selectFields
protected ModelFieldTypeReader modelFieldTypeReader
protected boolean closed
protected boolean haveMadeValue
protected GenericDelegator delegator
Constructor Detail |
---|
public EntityListIterator(SQLProcessor sqlp, ModelEntity modelEntity, java.util.List<ModelField> selectFields, ModelFieldTypeReader modelFieldTypeReader)
public EntityListIterator(java.sql.ResultSet resultSet, ModelEntity modelEntity, java.util.List<ModelField> selectFields, ModelFieldTypeReader modelFieldTypeReader)
Method Detail |
---|
public void setDelegator(GenericDelegator delegator)
public void afterLast() throws GenericEntityException
GenericEntityException
public void beforeFirst() throws GenericEntityException
GenericEntityException
public boolean last() throws GenericEntityException
GenericEntityException
public boolean first() throws GenericEntityException
GenericEntityException
public void close() throws GenericEntityException
GenericEntityException
public GenericValue currentGenericValue() throws GenericEntityException
GenericEntityException
public int currentIndex() throws GenericEntityException
GenericEntityException
public boolean absolute(int rowNum) throws GenericEntityException
GenericEntityException
public boolean relative(int rows) throws GenericEntityException
GenericEntityException
public boolean hasNext()
hasNext
in interface java.util.Iterator<GenericValue>
hasNext
in interface java.util.ListIterator<GenericValue>
public boolean hasPrevious()
hasPrevious
in interface java.util.ListIterator<GenericValue>
public GenericValue next()
next
in interface java.util.Iterator<GenericValue>
next
in interface java.util.ListIterator<GenericValue>
public int nextIndex()
nextIndex
in interface java.util.ListIterator<GenericValue>
public GenericValue previous()
previous
in interface java.util.ListIterator<GenericValue>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<GenericValue>
public void setFetchSize(int rows) throws GenericEntityException
GenericEntityException
public java.util.List<GenericValue> getCompleteList() throws GenericEntityException
GenericEntityException
public java.util.List<GenericValue> getPartialList(int start, int number) throws GenericEntityException
GenericEntityException
public int getResultsSizeAfterPartialList() throws GenericEntityException
GenericEntityException
public void add(GenericValue obj)
add
in interface java.util.ListIterator<GenericValue>
public void remove()
remove
in interface java.util.Iterator<GenericValue>
remove
in interface java.util.ListIterator<GenericValue>
public void set(GenericValue obj)
set
in interface java.util.ListIterator<GenericValue>
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |