|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.molindo.utils.collections.IteratorUtils
public class IteratorUtils
| Field Summary | |
|---|---|
static Iterator<?> |
EMPTY_ITERATOR
|
| Method Summary | ||
|---|---|---|
static
|
addAll(C collection,
Iterator<T> iter)
adds all elements from iter to collection |
|
static
|
cast(Class<T> cls,
Iterable<?> iterable)
a type safe cast for Iterable |
|
static
|
cast(Class<T> cls,
Object[] list)
type safe cast from any array to an Iterable |
|
static
|
empty()
type save access to EMPTY_ITERATOR |
|
static
|
iterable(Iterator<T> iter)
|
|
static
|
list(Iterator<T> iter)
|
|
static
|
list(Iterator<T> iter,
int initialCapacity)
|
|
static
|
max(Iterator<T> iter,
int max)
don't return more elements than given by max |
|
static
|
next(Iterator<T> iter)
|
|
static
|
skip(Iterator<T> iter,
int skip)
skips a given number of elements in iterator while there are available |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Iterator<?> EMPTY_ITERATOR
| Method Detail |
|---|
public static <T> Iterable<T> iterable(Iterator<T> iter)
T - iter -
Iterable that alway returns the passed
Iterator instancepublic static <T> T next(Iterator<T> iter)
T - iter -
null otherwisepublic static <T> ArrayList<T> list(Iterator<T> iter)
T - iter -
ArrayList containing all elements
public static <T> ArrayList<T> list(Iterator<T> iter,
int initialCapacity)
T - iter -
ArrayList containing all elements
public static <T,C extends Collection<T>> C addAll(C collection,
Iterator<T> iter)
T - C - collection - iter -
public static <T> Iterator<T> empty()
EMPTY_ITERATOR
T -
public static <T> Iterable<T> cast(Class<T> cls,
Object[] list)
Iterable
T - cls - list -
public static <T> Iterable<T> cast(Class<T> cls,
Iterable<?> iterable)
Iterable
T - cls - iterable -
public static <T> Iterator<T> skip(Iterator<T> iter,
int skip)
T - iter - skip -
public static <T> Iterator<T> max(Iterator<T> iter,
int max)
T - iter - max -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||