com.ibm.mashups.enabler
Interface DeferredIterator
- All Superinterfaces:
- Deferred, Iterator
public DeferredIterator
- extends Deferred, Iterator
The DeferredIterator can be used to iterate over a list of objects in an asynchronous fashion. The callback handler is called as soon as the next object has been loaded. The start method is only used for the asynchronous aspect of the deferred iterator. For the synchronous aspect the methods such as hasNext() can be called directly.
setForEachCallback
DeferredIterator setForEachCallback(Object callback,
Object[] parameters)
-
Sets the handler of the deferred action. It is called when the next object in the list has been loaded and is ready to be processed.
- Parameters:
callback
-
the callback funtion in the format of Function(object nextElement, Object[] params)
. Must not be null
Callbackparameters
nextElement
- the next object in the list
params
- the parameters passed into the addForEachCallbackparameters
-
optional array of parameters to be passed on to the callback function
- Returns:
-
the deferred object
Copyright IBM Corp. 2010 All Rights Reserved.