Modifier and Type | Method and Description |
---|---|
static <T> Iterable<T> |
concat(Iterable<? extends Iterable<? extends T>> inputs)
Combines multiple iterables into a single iterable.
|
static <T> Iterable<T> |
concat(Iterable<? extends T> a,
Iterable<? extends T> b)
Combines two iterables into a single iterable.
|
static <T> T |
getOnlyElement(Iterable<T> iterable)
Returns the single element contained in
iterable . |
static String |
toString(Iterable<?> iterable)
Returns a string representation of
iterable , with the format
[e1, e2, ..., en] . |
static <F,T> Iterable<T> |
transform(Iterable<F> fromIterable,
Function<? super F,? extends T> function)
Returns an iterable that applies
function to each element of fromIterable . |
public static String toString(Iterable<?> iterable)
iterable
, with the format
[e1, e2, ..., en]
.public static <T> T getOnlyElement(Iterable<T> iterable)
iterable
.NoSuchElementException
- if the iterable is emptyIllegalArgumentException
- if the iterable contains multiple
elementspublic static <T> Iterable<T> concat(Iterable<? extends T> a, Iterable<? extends T> b)
a
, followed by the elements
in b
. The source iterators are not polled until necessary.
The returned iterable's iterator supports remove()
when the
corresponding input iterator supports it.
public static <T> Iterable<T> concat(Iterable<? extends Iterable<? extends T>> inputs)
inputs
. The input iterators are not polled until necessary.
The returned iterable's iterator supports remove()
when the
corresponding input iterator supports it. The methods of the returned
iterable may throw NullPointerException
if any of the input
iterators are null.
public static <F,T> Iterable<T> transform(Iterable<F> fromIterable, Function<? super F,? extends T> function)
function
to each element of fromIterable
.
The returned iterable's iterator supports remove()
if the
provided iterator does. After a successful remove()
call,
fromIterable
no longer contains the corresponding element.
Copyright © 2006-2012 Google, Inc.. All Rights Reserved.