-
1. Re: RangeIterator.getNumberRemaining() missing
rhauch Jan 4, 2013 9:33 AM (in response to bwallis42)I actually don't remember that method being in JCR 1.0, either.
You can easily determine how many are left by using "ri.getSize() - ri.getPosition()".
-
2. Re: RangeIterator.getNumberRemaining() missing
bwallis42 Jan 7, 2013 5:09 PM (in response to rhauch)Randall Hauch wrote:
I actually don't remember that method being in JCR 1.0, either.
You can easily determine how many are left by using "ri.getSize() - ri.getPosition()".
Not always, the doco for RangeIterator.getSize() says that it must return -1 if it doesn't know what the size is and suggests using the missing getNumberRemaining() as an estimate of the remaining number.
{quote}
In some implementations precise information about the number of elements may not be available. In such cases this method must return -1. API clients will then be able to use
RangeIterator.getNumberRemaining
to get an estimate on the number of elements.{quote}
It isn't a big problem for me, I was just using the value to correctly size an allocated list for a return value, I can just let the list grow as needed but I can see in some cases where this might be more annoying.