Package org.jboss.weld.util.collections
Class Iterables
- java.lang.Object
-
- org.jboss.weld.util.collections.Iterables
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> booleanaddAll(Collection<T> target, Iterable<? extends T> iterable)Add all elements in the iterable to the collection.static <T> Iterable<T>concat(Iterable<? extends Iterable<? extends T>> iterables)Combine the iterables into a single one.static <T> Iterable<T>concat(Iterable<? extends T> a, Iterable<? extends T> b)Combine the iterables into a single one.static <T,R>
Iterable<R>flatMap(Iterable<T> iterable, Function<? super T,? extends Iterable<? extends R>> function)static <T> Iterator<Iterator<? extends T>>iterators(Iterable<? extends Iterable<? extends T>> iterables)static <T> StringtoMultiRowString(Iterable<T> iterable)static <T,R>
Iterable<R>transform(Iterable<T> iterable, Function<? super T,? extends R> function)
-
-
-
Method Detail
-
addAll
public static <T> boolean addAll(Collection<T> target, Iterable<? extends T> iterable)
Add all elements in the iterable to the collection.- Parameters:
target-iterable-- Returns:
- true if the target was modified, false otherwise
-
concat
public static <T> Iterable<T> concat(Iterable<? extends Iterable<? extends T>> iterables)
Combine the iterables into a single one.- Parameters:
iterables-- Returns:
- a single combined iterable
-
concat
public static <T> Iterable<T> concat(Iterable<? extends T> a, Iterable<? extends T> b)
Combine the iterables into a single one.
-
iterators
public static <T> Iterator<Iterator<? extends T>> iterators(Iterable<? extends Iterable<? extends T>> iterables)
- Parameters:
iterables-- Returns:
- an iterator over iterators from the given iterable of iterables
-
transform
public static <T,R> Iterable<R> transform(Iterable<T> iterable, Function<? super T,? extends R> function)
-
flatMap
public static <T,R> Iterable<R> flatMap(Iterable<T> iterable, Function<? super T,? extends Iterable<? extends R>> function)
-
toMultiRowString
public static <T> String toMultiRowString(Iterable<T> iterable)
- Parameters:
iterable-- Returns:
- See Also:
WeldCollections.toMultiRowString(Collection)
-
-