コード例 #1
0
ファイル: IterableFuncSup.java プロジェクト: wkgcass/common
 @Override
 public Coll via(def<R> method) {
   $(iterable)
       .forEach(
           e -> {
             collection.add(method.apply(e));
           });
   return collection;
 }
コード例 #2
0
ファイル: IterableFuncSup.java プロジェクト: wkgcass/common
 @Override
 public <Coll extends Collection<T>> Coll findAll(def<Boolean> filter, Coll toColl, int limit) {
   return $(iterable)
       .to(toColl)
       .via(
           e -> {
             Boolean ret = filter.apply(e);
             if (null == ret || ret.equals(false)) Continue();
             if (limit > 0 && limit <= toColl.size()) {
               Break();
             }
             return e;
           });
 }