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.


Method Summary
 DeferredIterator setForEachCallback(Object callback, Object[] parameters)
           Sets the handler of the deferred action.
 
Methods inherited from interface com.ibm.mashups.enabler.Deferred
setFinishedCallback, start
 
Methods inherited from interface com.ibm.mashups.enabler.Iterator
hasNext, next, size, setCursorPosition, getCursorPosition
 

Method Detail

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 addForEachCallback
parameters - optional array of parameters to be passed on to the callback function
Returns:
the deferred object


Copyright IBM Corp. 2010 All Rights Reserved.