T
- public class RoundRobinIterator<T> extends Object implements Iterator<T>
This is useful to deal with connection pools.
Modifier and Type | Method and Description |
---|---|
static <T> RoundRobinIterator<T> |
createDisabled(List<T> collection)
Create a round robin iterator that is disabled to start with.
|
static <T> RoundRobinIterator<T> |
createEnabled(List<T> coll)
Create a round robin iterator that is enabled at startup.
|
List<T> |
getDisabledItems() |
boolean |
hasDisabledItems() |
boolean |
hasNext() |
T |
next() |
void |
remove() |
void |
restore(T v)
Mark an item as enabled.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public static <T> RoundRobinIterator<T> createDisabled(List<T> collection)
T
- collection
- you itemspublic static <T> RoundRobinIterator<T> createEnabled(List<T> coll)
T
- collection
- you itemspublic void restore(T v)
v
- the item to re-enablepublic boolean hasDisabledItems()
Copyright © 2014–2022. All rights reserved.