Author: jonesde
Date: Tue Jul 1 01:50:58 2008
New Revision: 673024
URL:
http://svn.apache.org/viewvc?rev=673024&view=revLog:
Added small convenience method to get total size of results after getting a partial list
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java?rev=673024&r1=673023&r2=673024&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java Tue Jul 1 01:50:58 2008
@@ -488,6 +488,15 @@
throw new GenericEntityException(e.getNonNestedMessage(), e.getNested());
}
}
+
+ public int getResultsSizeAfterPartialList() throws GenericEntityException {
+ if (this.last()) {
+ return this.currentIndex();
+ } else {
+ // evidently no valid rows in the ResultSet, so return 0
+ return 0;
+ }
+ }
public void add(GenericValue obj) {
throw new GeneralRuntimeException("CursorListIterator currently only supports read-only access");