| Modifier and Type | Method and Description |
|---|---|
static <T> Iterable<T> |
append(Iterable<T> iterable,
T... elements) |
static <T> Iterable<T> |
append(Iterable<T> iterable,
T element) |
static <F,T> Iterable<T> |
applyFunctions(Iterable<com.google.common.base.Function<F,T>> functions,
F argument)
Compute a sequence of results by applying each function form the list to
the same argument.
|
static <T> Iterable<T> |
concurrentModifiable(List<T> sequence) |
static <T> Iterable<T> |
getDescendants(Iterable<T> parentElements,
com.google.common.base.Function<T,Iterable<T>> getChildFunction) |
static <T> Iterable<T> |
getDescendants(T parentElement,
com.google.common.base.Function<T,Iterable<T>> getChildFunction) |
static <T> T |
getFirst(Iterable<T> elements) |
static <T> T |
getFirst(Iterable<T> elements,
T defaultElement) |
static <T> T |
getFirstNonNull(Iterable<T> elements,
T defaultValue)
Returns the first non-null element from the specified sequence, or the
specified default value if all elements from the sequence were
null. |
static <T> T |
getFirstNonNull(T... elements)
Returns the first non-null element from the specified sequence, or
null if all elements from the sequence were null. |
static <T> T |
getLast(Iterable<T> elements)
Get the last argument from a sequence, or
null if there is
no such last element. |
static <T> T |
getLast(Iterable<T> elements,
T defaultElement)
Get the last argument from a sequence, or
defaultElement if
there is no such last element. |
static <T> Iterable<T> |
prepend(Iterable<T> iterable,
T... elements) |
static <T> Iterable<T> |
removeAll(BlockingQueue<T> fromQueue)
Returns an
Iterable that contains the elements from the queue. |
static boolean |
removeAll(Iterable<?> iterable) |
static <T> Iterable<T> |
until(Iterable<T> elements,
com.google.common.base.Predicate<T> predicate)
Returns the elements from the passed sequence up to the first element
that matches the passed predicate (this element is excluded from the
result sequence).
|
@ReturnsNullable public static <T> T getLast(Iterable<T> elements)
null if there is
no such last element.@ReturnsNullable public static <T> T getLast(Iterable<T> elements, T defaultElement)
defaultElement if
there is no such last element.public static <T> T getFirst(Iterable<T> elements)
public static <T> T getFirst(Iterable<T> elements, T defaultElement)
public static <F,T> Iterable<T> applyFunctions(Iterable<com.google.common.base.Function<F,T>> functions, F argument)
public static <T> Iterable<T> getDescendants(Iterable<T> parentElements, com.google.common.base.Function<T,Iterable<T>> getChildFunction)
public static <T> Iterable<T> getDescendants(T parentElement, com.google.common.base.Function<T,Iterable<T>> getChildFunction)
public static boolean removeAll(Iterable<?> iterable)
public static <T> Iterable<T> until(Iterable<T> elements, com.google.common.base.Predicate<T> predicate)
Returned Iterable will throw NoSuchElementException if
the predicate does not match for any element from the sequence.
public static <T> Iterable<T> removeAll(BlockingQueue<T> fromQueue)
Iterable that contains the elements from the queue.TcIterators.removeAll(BlockingQueue)public static <T> T getFirstNonNull(Iterable<T> elements, T defaultValue)
null.public static <T> T getFirstNonNull(T... elements)
null if all elements from the sequence were null.Copyright © 2009-2012 TranceCode. All Rights Reserved.