ERXRoundRobinCollection< E > Class Reference

Collaboration diagram for ERXRoundRobinCollection< E >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

NSArray< E > array ()
 ERXRoundRobinCollection (final NSArray< E > collection)
synchronized E next ()

Private Attributes

final NSArray< E > _collection
volatile Iterator< E > _iterator
_singleItem


Detailed Description

A simple thread-safe class that returns the next item in a list in round robin fashion. If only one item in the collection, the juggling is bypassed and that same item is returned every time.

Author:
kieran
Parameters:
<E> 

Constructor & Destructor Documentation

ERXRoundRobinCollection ( final NSArray< E >  collection  ) 


Member Function Documentation

NSArray<E> array (  ) 

Returns:
the array of objects in the pool

synchronized E next (  ) 

Returns:
the next item in the pool infinitely. When end of the list is reached, the first item in the list is returned.


Member Data Documentation

final NSArray<E> _collection [private]

volatile Iterator<E> _iterator [private]

E _singleItem [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:13 2012 for Project Wonder by  doxygen 1.5.8