@Override public boolean hasNext() { return !current.isEmpty(); }
@Override public Boolean coerce(Flow input) { return !input.isEmpty(); } }));
@Override public boolean isEmpty() { return tupleFlow.isEmpty(); }
@Override public boolean hasNext() { return !current.isEmpty(); }
public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model) { Flow<PlasticMethod> methods = matchEventHandlerMethods(plasticClass); if (methods.isEmpty()) return; if(!model.getMixinClassNames().contains(Selector.class.getName())){ model.addMixinClassName(Selector.class.getName(),"before:*"); } } private Flow<PlasticMethod> matchEventHandlerMethods(PlasticClass plasticClass)
@Override public int count() { if (isEmpty()){ return 0; } int count = 0; for(Flow<T> flow = this; flow != null && !flow.isEmpty(); flow = flow.rest()){ count++; } return count; }
@Override public int count() { if (isEmpty()){ return 0; } int count = 0; for(Flow<T> flow = this; flow != null && !flow.isEmpty(); flow = flow.rest()){ count++; } return count; }
@Override public <X, Y> Flow<Y> map(Mapper2<T, X, Y> mapper, Flow<? extends X> flow) { assert mapper != null; assert flow != null; if (this.isEmpty() || flow.isEmpty()) return F.emptyFlow(); return F.lazy(new LazyMapper2<T, X, Y>(mapper, this, flow)); }
@Override public <X, Y> Flow<Y> map(Mapper2<T, X, Y> mapper, Flow<? extends X> flow) { assert mapper != null; assert flow != null; if (this.isEmpty() || flow.isEmpty()) return F.emptyFlow(); return F.lazy(new LazyMapper2<T, X, Y>(mapper, this, flow)); }
@Override public LazyContinuation<X> next() { if (flow.isEmpty()) return null; LazyValue<X> nextValue = new LazyMappedValue<T, X>(flow, mapper); return new LazyContinuation<X>(nextValue, new LazyMapper<T, X>(mapper, flow.rest())); }
@Test public void list_of_empty_flow_is_empty() { assertTrue(filteredEmpty.isEmpty()); assertSame(filteredEmpty.toList(), Collections.EMPTY_LIST); }
@Override public LazyContinuation<T> next() { if (flow.isEmpty() || length < 1) return null; return new LazyContinuation<T>(new LazyFirst<T>(flow), new LazyTake<T>(length - 1, flow.rest())); }
@Override public LazyContinuation<T> next() { if (flow.isEmpty()) return null; return new LazyContinuation<T>(new LazyFirst<T>(flow), new LazyWalk<T>(flow.rest())); } }
@Override public LazyContinuation<T> next() { if (flow.isEmpty()) return null; return new LazyContinuation<T>(new LazyFirst<T>(flow), new LazyWalk<T>(flow.rest())); } }
@Test public void drop_exact_size_of_flow_is_empty() { assertTrue(F.range(1, 10).filter(evenp).drop(4).isEmpty()); }
@Test public void mapcat_on_empty_flow_is_empty() { Flow<Integer> flow = F.flow(); assertSame(flow.mapcat(sequencer), flow); assertTrue(filteredEmpty.mapcat(sequencer).isEmpty()); }