Modifier and Type | Class and Description |
---|---|
static interface |
IterableUtil.ElementWithContext<T>
Deprecated.
Use
ElementWithContext instead |
Modifier and Type | Field and Description |
---|---|
static Iterable<Integer> |
NATURALS
Produces the sequence 1, 2, 3, ...
|
static Iterable<Integer> |
NATURALS0
Produces the sequence 0, 1, 2, ...
|
Modifier and Type | Method and Description |
---|---|
static <T> void |
addAllElementsTo(Iterable<T> iterable,
Collection<? super T> target)
Adds all elements of the iterable to the target collection.
|
static <T> Collection<T> |
asCollection(Iterable<T> delegate)
Wraps the given
Iterable in a collection. |
static <T> Iterable<T> |
concat(Iterable<? extends Iterable<? extends T>> elements) |
static <T> Iterable<T> |
concat(Iterable<? extends T> element1,
Iterable<? extends T> element2) |
static <T> Iterable<T> |
concat(Iterable<? extends T> element1,
Iterable<? extends T> element2,
Iterable<? extends T> element3) |
static <T> Iterable<T> |
concat(Iterable<? extends T> element1,
Iterable<? extends T> element2,
Iterable<? extends T> element3,
Iterable<? extends T> element4) |
static <T> Iterable<T> |
concat(Iterable<? extends T> element1,
T... element2) |
static <T> Iterable<T> |
concat(T element1,
Iterable<? extends T> element2) |
static <T> Iterable<T> |
concat(T element1,
T element2,
Iterable<? extends T> element3) |
static <T> Iterable<T> |
filter(Iterable<? extends T> delegate,
Predicate<? super T> qualifies)
Returns an
Iterable which hides the elements of the delegate which do not qualifiy. |
static Iterable<Integer> |
foR(int start,
int end)
|
static Iterable<Integer> |
foR(int start,
int end,
int step)
Returns a sequence of integers which reach from start (inclusively) to end (exclusively),
with a step increment.
|
static <T> Iterable<ElementWithContext<T>> |
iterableWithContext(Iterable<? extends T> delegate)
Wraps the delegate iterable in an
Iterable<ElementWithContext> . |
static <T> Iterator<ElementWithContext<T>> |
iteratorWithContext(Iterator<? extends T> delegate)
Deprecated.
Use
IteratorUtil.iteratorWithContext(Iterator) instead |
static <T> Iterable<T> |
repeat(T subject,
int n) |
static <E> Iterable<E> |
reverseList(List<E> list) |
static <I,O> Iterable<O> |
transform(Iterable<? extends I> delegate,
Transformer<? super I,? extends O> transform)
Returns an iterable which contains the transformed elements of the delegate
|
static <T> Iterable<T> |
unmodifiableIterable(Iterable<? extends T> i) |
public static final Iterable<Integer> NATURALS
Integer.MAX_VALUE
public static final Iterable<Integer> NATURALS0
Integer.MAX_VALUE
public static <T> Iterable<T> unmodifiableIterable(Iterable<? extends T> i)
Iterable
which can't be modified through the Iterator.remove()
methodpublic static <T> Iterable<T> repeat(T subject, int n)
Iterable
producing the given subject n timespublic static <T> Iterable<T> concat(T element1, Iterable<? extends T> element2)
public static <T> Iterable<T> concat(T element1, T element2, Iterable<? extends T> element3)
public static <T> Iterable<T> concat(Iterable<? extends T> element1, T... element2)
public static <T> Iterable<T> concat(Iterable<? extends T> element1, Iterable<? extends T> element2)
public static <T> Iterable<T> concat(Iterable<? extends T> element1, Iterable<? extends T> element2, Iterable<? extends T> element3)
public static <T> Iterable<T> concat(Iterable<? extends T> element1, Iterable<? extends T> element2, Iterable<? extends T> element3, Iterable<? extends T> element4)
public static <T> Iterable<T> concat(Iterable<? extends Iterable<? extends T>> elements)
public static <T> Iterable<T> filter(Iterable<? extends T> delegate, Predicate<? super T> qualifies)
Iterable
which hides the elements of the delegate which do not qualifiy.public static <I,O> Iterable<O> transform(Iterable<? extends I> delegate, Transformer<? super I,? extends O> transform)
public static <T> Collection<T> asCollection(Iterable<T> delegate)
public static <T> Iterable<ElementWithContext<T>> iterableWithContext(Iterable<? extends T> delegate)
Iterable<ElementWithContext>
.@Deprecated public static <T> Iterator<ElementWithContext<T>> iteratorWithContext(Iterator<? extends T> delegate)
IteratorUtil.iteratorWithContext(Iterator)
insteadpublic static Iterable<Integer> foR(int start, int end)
foR(int, int, int)
public static Iterable<Integer> foR(int start, int end, int step)
More precise: Iff step is greater than zero, then the sequence is start,
start +
step, and so forth, and ends with the last value which is less than
end.
Otherwise, iff step is less than zero, then the sequence is start,
start +
step, and so forth, and ends with the last value which is greater than
end.
Otherwise, step is zero, and the returned sequence is either an
infinite sequence of values start, or, iff start ==
end, an empty
sequence.
IllegalArgumentException
- step > 0 &&
end <
startIllegalArgumentException
- step < 0 &&
end >
startpublic static <T> void addAllElementsTo(Iterable<T> iterable, Collection<? super T> target)
Copyright © 2018 Arno Unkrig. All rights reserved.