Пример #1
0
 public static boolean notEmpty(Iterable<?> iterable) {
   return !IterableIterate.isEmpty(iterable);
 }
Пример #2
0
 /** @see Iterate#filter(Iterable, Predicate) */
 public static <T> MutableList<T> filter(Iterable<T> iterable, Predicate<? super T> predicate) {
   return IterableIterate.filter(iterable, predicate, FastList.<T>newList());
 }
Пример #3
0
 /** @see Iterate#transformIf(Iterable, Predicate, Function) */
 public static <T, V> MutableList<V> transformIf(
     Iterable<T> iterable,
     Predicate<? super T> predicate,
     Function<? super T, ? extends V> function) {
   return IterableIterate.tranformIf(iterable, predicate, function, FastList.<V>newList());
 }
Пример #4
0
 /** @see Iterate#zip(Iterable, Iterable) */
 public static <X, Y> Collection<Pair<X, Y>> zip(Iterable<X> xs, Iterable<Y> ys) {
   return IterableIterate.zip(xs, ys, FastList.<Pair<X, Y>>newList());
 }
Пример #5
0
 /** @see Iterate#zipWithIndex(Iterable) */
 public static <T> Collection<Pair<T, Integer>> zipWithIndex(Iterable<T> iterable) {
   return IterableIterate.zipWithIndex(iterable, FastList.<Pair<T, Integer>>newList());
 }
Пример #6
0
 /** @see Iterate#groupByEach(Iterable, Function) */
 public static <T, V> FastListMultimap<V, T> groupByEach(
     Iterable<T> iterable, Function<? super T, ? extends Iterable<V>> function) {
   return IterableIterate.groupByEach(iterable, function, new FastListMultimap<V, T>());
 }
Пример #7
0
 /** @see Iterate#drop(Iterable, int) */
 public static <T> Collection<T> drop(Iterable<T> list, int count) {
   if (count < 0) {
     throw new IllegalArgumentException("Count must be greater than zero, but was: " + count);
   }
   return IterableIterate.drop(list, count, FastList.<T>newList());
 }
Пример #8
0
 /** @see Iterate#transformWith(Iterable, Function2, Object) */
 public static <T, P, V> MutableList<V> transformWith(
     Iterable<T> iterable, Function2<? super T, ? super P, ? extends V> function, P parameter) {
   return IterableIterate.transformWith(iterable, function, parameter, FastList.<V>newList());
 }
Пример #9
0
 /** @see Iterate#flatTransform(Iterable, Function) */
 public static <T, V> MutableList<V> flatTransform(
     Iterable<T> iterable, Function<? super T, ? extends Iterable<V>> function) {
   return IterableIterate.flatTransform(iterable, function, FastList.<V>newList());
 }
Пример #10
0
 /** @see Iterate#filterNot(Iterable, Predicate) */
 public static <T> MutableList<T> filterNot(
     Iterable<T> collection, Predicate<? super T> predicate) {
   return IterableIterate.filterNot(collection, predicate, FastList.<T>newList());
 }