public void value(Iterable<E> iterable) { Iterate.forEachWith(iterable, procedure, parameter); } });
@Override public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) { Iterate.forEachWith(this.adapted, procedure, parameter); }
@Override public <P> void forEachWith(final Procedure2<? super T, ? super P> procedure, P parameter) { Iterate.forEachWith(this.adapted, new Procedure2<T, P>() { public void value(T each, P aParameter) { TapIterable.this.procedure.value(each); procedure.value(each, aParameter); } }, parameter); }
@Override public <P> void forEachWith(Procedure2<? super V, ? super P> procedure, P parameter) { Iterate.forEachWith(this.delegate.values(), procedure, parameter); }
public void value(T each) { Iterate.forEachWith(FlatCollectIterable.this.function.valueOf(each), procedure, parameter); } });
@Override public <P> void forEachWith(Procedure2<? super V, ? super P> procedure, P parameter) { Iterate.forEachWith(this.values(), procedure, parameter); }
@Override public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) { Iterate.forEachWith(this.adapted, new IfProcedureWith<T, P>(this.predicate, procedure), parameter); }
@Override public <P> void forEachWith(Procedure2<? super V, ? super P> procedure, P parameter) { Iterate.forEachWith(this.adapted, Functions.bind(procedure, this.function), parameter); }
@Override public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) { Iterate.forEachWith(this.adapted, new IfProcedureWith<T, P>(this.predicate, procedure), parameter); }
@Override public <P> void forEachWith(Procedure2<? super V, ? super P> procedure, P parameter) { Iterate.forEachWith(this.values(), procedure, parameter); }
public void value(V each) { Iterate.forEachWith(this.keyFunction.valueOf(each), this.eachProcedure, each); } }
public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) { Iterate.forEachWith(this.getDelegate(), procedure, parameter); }
/** * Remove all elements present in Iterable from the target collection, returns true if any element was removed. */ public static <T> boolean removeAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection) { if (iterable == null) { throw new NullPointerException(); } if (iterable instanceof Collection<?>) { return targetCollection.removeAll((Collection<T>) iterable); } int oldSize = targetCollection.size(); Iterate.forEachWith(iterable, Procedures2.<T>removeFromCollection(), targetCollection); return targetCollection.size() != oldSize; }
/** * Add all elements from the source Iterable to the target collection, returns true if any element was added. */ public static <T> boolean addAllIterable(Iterable<? extends T> iterable, Collection<T> targetCollection) { if (iterable == null) { throw new NullPointerException(); } if (iterable instanceof Collection<?>) { return targetCollection.addAll((Collection<T>) iterable); } int oldSize = targetCollection.size(); Iterate.forEachWith(iterable, Procedures2.<T>addToCollection(), targetCollection); return targetCollection.size() != oldSize; }
private void addAllCollection(Collection<? extends T> source) { this.ensureCapacity(this.size + source.size()); Iterate.forEachWith(source, Procedures2.<T>addToCollection(), this); }
@Override public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) { Iterate.forEachWith((Iterable<T>) this.adapted, new IfProcedureWith<T, P>(Predicates.instanceOf(this.clazz), procedure), parameter); }
public boolean addAllIterable(Iterable<? extends T> iterable) { int oldSize = this.size(); Iterate.forEachWith(iterable, Procedures2.<T>addToCollection(), this); return oldSize != this.size(); }
public boolean addAllIterable(Iterable<? extends T> iterable) { int oldSize = this.size(); if (iterable instanceof List && iterable instanceof RandomAccess) { List<T> list = (List<T>) iterable; int size = list.size(); for (int i = 0; i < size; i++) { this.add(list.get(i)); } } else { Iterate.forEachWith(iterable, Procedures2.<T>addToCollection(), this); } return oldSize != this.size(); }
@Override public <P> void forEachWith(Procedure2<? super T, ? super P> procedure, P parameter) { Iterate.forEachWith(this.adapted, new IfProcedureWith<T, P>(new DropIterablePredicate<T>(this.count), procedure), parameter); }
public boolean addAllIterable(Iterable<? extends T> iterable) { if (iterable instanceof UnifiedSetWithHashingStrategy) { return this.copySet((UnifiedSetWithHashingStrategy<?>) iterable); } int size = Iterate.sizeOf(iterable); this.ensureCapacity(size); int oldSize = this.size(); Iterate.forEachWith(iterable, Procedures2.<T>addToCollection(), this); return this.size() != oldSize; }