Ejemplo n.º 1
0
 public static <T> T produceLevelAware(int level, Producer<T> after, Producer<T> before) {
   T result = null;
   if (Build.VERSION.SDK_INT >= level) {
     if (null != after) result = after.produce();
   } else {
     if (null != before) result = before.produce();
   }
   return result;
 }
Ejemplo n.º 2
0
 public int reduce(int base, IntBinaryOperator reducerOp) {
   IntTransformer.ReducerTail reducer = new IntTransformer.ReducerTail(reducerOp, base);
   Producer producer = producer(reducer);
   while (producer.produce()) {}
   return reducer.getResult();
 }