org.apache.sling.event.jobs
Interface JobsIterator

All Superinterfaces:
Iterable<org.osgi.service.event.Event>, Iterator<org.osgi.service.event.Event>
All Known Subinterfaces:
JobsIterator

public interface JobsIterator
extends Iterator<org.osgi.service.event.Event>, Iterable<org.osgi.service.event.Event>

This Iterator allows to iterate over Events. In addition to an iterator it might return the number of elements in the collection and allows to skip several elements.

Since:
3.0

Method Summary
 long getPosition()
          Returns the current position within the iterator.
 long getSize()
          Returns the total number of jobs.
 void skip(long skipNum)
          Skip a number of jobs.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

skip

void skip(long skipNum)
Skip a number of jobs.

Parameters:
skipNum - the non-negative number of elements to skip
Throws:
NoSuchElementException - if skipped past the last job in the iterator.

getSize

long getSize()
Returns the total number of jobs. In some cases a precise information is not available. In these cases -1 is returned.


getPosition

long getPosition()
Returns the current position within the iterator. The number returned is the 0-based index of the next job.



Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.