public final class ArrayListIterate
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T,K,V> com.gs.collections.api.map.MutableMap<K,V> |
aggregateBy(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends K> groupBy,
com.gs.collections.api.block.function.Function0<? extends V> zeroValueFactory,
com.gs.collections.api.block.function.Function2<? super V,? super T,? extends V> nonMutatingAggregator) |
static <T,K,V> com.gs.collections.api.map.MutableMap<K,V> |
aggregateInPlaceBy(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends K> groupBy,
com.gs.collections.api.block.function.Function0<? extends V> zeroValueFactory,
com.gs.collections.api.block.procedure.Procedure2<? super V,? super T> mutatingAggregator) |
static <T> boolean |
allSatisfy(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,IV> boolean |
allSatisfyWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue) |
static <T> boolean |
anySatisfy(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,P> boolean |
anySatisfyWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter) |
static <T,A> java.util.ArrayList<A> |
collect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends A> function) |
static <T,A,R extends java.util.Collection<A>> |
collect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends A> function,
R targetCollection) |
static <T> com.gs.collections.api.list.primitive.MutableBooleanList |
collectBoolean(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.BooleanFunction<? super T> booleanFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableBooleanCollection> |
collectBoolean(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.BooleanFunction<? super T> booleanFunction,
R target) |
static <T> com.gs.collections.api.list.primitive.MutableByteList |
collectByte(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ByteFunction<? super T> byteFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableByteCollection> |
collectByte(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ByteFunction<? super T> byteFunction,
R target) |
static <T> com.gs.collections.api.list.primitive.MutableCharList |
collectChar(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.CharFunction<? super T> charFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableCharCollection> |
collectChar(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.CharFunction<? super T> charFunction,
R target) |
static <T> com.gs.collections.api.list.primitive.MutableDoubleList |
collectDouble(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.DoubleFunction<? super T> doubleFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableDoubleCollection> |
collectDouble(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.DoubleFunction<? super T> doubleFunction,
R target) |
static <T> com.gs.collections.api.list.primitive.MutableFloatList |
collectFloat(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.FloatFunction<? super T> floatFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableFloatCollection> |
collectFloat(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.FloatFunction<? super T> floatFunction,
R target) |
static <T,A> java.util.ArrayList<A> |
collectIf(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
com.gs.collections.api.block.function.Function<? super T,? extends A> function) |
static <T,A,R extends java.util.Collection<A>> |
collectIf(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
com.gs.collections.api.block.function.Function<? super T,? extends A> function,
R targetCollection) |
static <T> com.gs.collections.api.list.primitive.MutableIntList |
collectInt(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.IntFunction<? super T> intFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableIntCollection> |
collectInt(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.IntFunction<? super T> intFunction,
R target) |
static <T> com.gs.collections.api.list.primitive.MutableLongList |
collectLong(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.LongFunction<? super T> longFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableLongCollection> |
collectLong(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.LongFunction<? super T> longFunction,
R target) |
static <T> com.gs.collections.api.list.primitive.MutableShortList |
collectShort(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ShortFunction<? super T> shortFunction) |
static <T,R extends com.gs.collections.api.collection.primitive.MutableShortCollection> |
collectShort(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ShortFunction<? super T> shortFunction,
R target) |
static <T,P,A> java.util.ArrayList<A> |
collectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function2<? super T,? super P,? extends A> function,
P parameter) |
static <T,P,A,R extends java.util.Collection<A>> |
collectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function2<? super T,? super P,? extends A> function,
P parameter,
R targetCollection) |
static <T> int |
count(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,P> int |
countWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter) |
static <T> T |
detect(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T> T |
detectIfNone(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
T ifNone) |
static <T> int |
detectIndex(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,P> int |
detectIndexWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter) |
static <T,P> T |
detectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter) |
static <T,IV> T |
detectWithIfNone(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue,
T ifNone) |
static <T> java.util.ArrayList<T> |
distinct(java.util.ArrayList<T> list) |
static <T,R extends java.util.Collection<T>> |
distinct(java.util.ArrayList<T> list,
R targetCollection) |
static <T> java.util.ArrayList<T> |
drop(java.util.ArrayList<T> list,
int count) |
static <T,R extends java.util.Collection<T>> |
drop(java.util.ArrayList<T> list,
int count,
R targetList) |
static <T> com.gs.collections.api.list.MutableList<T> |
dropWhile(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,A> java.util.ArrayList<A> |
flatCollect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<A>> function) |
static <T,A,R extends java.util.Collection<A>> |
flatCollect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<A>> function,
R targetCollection) |
static <T> void |
forEach(java.util.ArrayList<T> list,
int from,
int to,
com.gs.collections.api.block.procedure.Procedure<? super T> procedure)
Iterates over the section of the list covered by the specified indexes.
|
static <T> void |
forEach(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.Procedure<? super T> procedure) |
static <T1,T2> void |
forEachInBoth(java.util.ArrayList<T1> list1,
java.util.ArrayList<T2> list2,
com.gs.collections.api.block.procedure.Procedure2<? super T1,? super T2> procedure) |
static <T,P> void |
forEachWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.Procedure2<? super T,? super P> procedure,
P parameter) |
static <T> void |
forEachWithIndex(java.util.ArrayList<T> list,
int from,
int to,
com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super T> objectIntProcedure)
Iterates over the section of the list covered by the specified indexes.
|
static <T> void |
forEachWithIndex(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super T> objectIntProcedure) |
static <T,V> FastListMultimap<V,T> |
groupBy(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends V> function) |
static <T,V,R extends com.gs.collections.api.multimap.MutableMultimap<V,T>> |
groupBy(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends V> function,
R target) |
static <T,V> FastListMultimap<V,T> |
groupByEach(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<V>> function) |
static <T,V,R extends com.gs.collections.api.multimap.MutableMultimap<V,T>> |
groupByEach(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<V>> function,
R target) |
static <T> double |
injectInto(double injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.DoubleObjectToDoubleFunction<? super T> function) |
static <T> float |
injectInto(float injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.FloatObjectToFloatFunction<? super T> function) |
static <T> int |
injectInto(int injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.IntObjectToIntFunction<? super T> function) |
static <T,IV> IV |
injectInto(IV injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function2<? super IV,? super T,? extends IV> function) |
static <T> long |
injectInto(long injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.LongObjectToLongFunction<? super T> function) |
static <T,IV,P> IV |
injectIntoWith(IV injectedValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function3<? super IV,? super T,? super P,? extends IV> function,
P parameter) |
static <T> boolean |
noneSatisfy(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,IV> boolean |
noneSatisfyWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue) |
static <T> com.gs.collections.api.partition.list.PartitionMutableList<T> |
partition(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T> com.gs.collections.api.partition.list.PartitionMutableList<T> |
partitionWhile(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,P> com.gs.collections.api.partition.list.PartitionMutableList<T> |
partitionWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter) |
static <T> java.util.ArrayList<T> |
reject(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,R extends java.util.Collection<T>> |
reject(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
R targetCollection) |
static <T,IV> java.util.ArrayList<T> |
rejectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue) |
static <T,P,R extends java.util.Collection<T>> |
rejectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P injectedValue,
R targetCollection) |
static <T> java.util.ArrayList<T> |
removeIf(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,P> java.util.ArrayList<T> |
removeIfWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter) |
static <T> void |
reverseForEach(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.Procedure<? super T> procedure)
Reverses over the List in reverse order executing the Procedure for each element
|
static <T> java.util.ArrayList<T> |
select(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T,R extends java.util.Collection<T>> |
select(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
R targetCollection) |
static <T,P> com.gs.collections.api.tuple.Twin<com.gs.collections.api.list.MutableList<T>> |
selectAndRejectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter) |
static <T> com.gs.collections.api.list.MutableList<T> |
selectInstancesOf(java.util.ArrayList<?> list,
java.lang.Class<T> clazz) |
static <T,IV> java.util.ArrayList<T> |
selectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue) |
static <T,P,R extends java.util.Collection<T>> |
selectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter,
R targetCollection) |
static <T extends java.lang.Comparable<? super T>> |
sortThis(java.util.ArrayList<T> list)
Mutates the internal array of the ArrayList by sorting it and then returns the same ArrayList.
|
static <T> java.util.ArrayList<T> |
sortThis(java.util.ArrayList<T> list,
java.util.Comparator<? super T> comparator)
Mutates the internal array of the ArrayList by sorting it and then returns the same ArrayList.
|
static <T> java.util.ArrayList<T> |
take(java.util.ArrayList<T> list,
int count) |
static <T,R extends java.util.Collection<T>> |
take(java.util.ArrayList<T> list,
int count,
R targetList) |
static <T> com.gs.collections.api.list.MutableList<T> |
takeWhile(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate) |
static <T> void |
toArray(java.util.ArrayList<T> list,
T[] target,
int startIndex,
int sourceSize) |
static <X,Y> com.gs.collections.api.list.MutableList<com.gs.collections.api.tuple.Pair<X,Y>> |
zip(java.util.ArrayList<X> xs,
java.lang.Iterable<Y> ys) |
static <X,Y,R extends java.util.Collection<com.gs.collections.api.tuple.Pair<X,Y>>> |
zip(java.util.ArrayList<X> xs,
java.lang.Iterable<Y> ys,
R targetCollection) |
static <T> com.gs.collections.api.list.MutableList<com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> |
zipWithIndex(java.util.ArrayList<T> list) |
static <T,R extends java.util.Collection<com.gs.collections.api.tuple.Pair<T,java.lang.Integer>>> |
zipWithIndex(java.util.ArrayList<T> list,
R targetCollection) |
public static <T> java.util.ArrayList<T> select(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
Iterate.select(Iterable, Predicate)public static <T,IV> java.util.ArrayList<T> selectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue)
public static <T,R extends java.util.Collection<T>> R select(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
R targetCollection)
public static <T,P,R extends java.util.Collection<T>> R selectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter,
R targetCollection)
public static <T> com.gs.collections.api.list.MutableList<T> selectInstancesOf(java.util.ArrayList<?> list,
java.lang.Class<T> clazz)
public static <T> int count(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
Iterate.count(Iterable, Predicate)public static <T,P> int countWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter)
public static <T,A> java.util.ArrayList<A> collectIf(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
com.gs.collections.api.block.function.Function<? super T,? extends A> function)
public static <T,A,R extends java.util.Collection<A>> R collectIf(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
com.gs.collections.api.block.function.Function<? super T,? extends A> function,
R targetCollection)
public static <T> java.util.ArrayList<T> reject(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
Iterate.reject(Iterable, Predicate)public static <T,IV> java.util.ArrayList<T> rejectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue)
public static <T,R extends java.util.Collection<T>> R reject(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
R targetCollection)
public static <T,P,R extends java.util.Collection<T>> R rejectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P injectedValue,
R targetCollection)
public static <T,A> java.util.ArrayList<A> collect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends A> function)
Iterate.collect(Iterable, Function)public static <T> com.gs.collections.api.list.primitive.MutableBooleanList collectBoolean(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.BooleanFunction<? super T> booleanFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableBooleanCollection> R collectBoolean(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.BooleanFunction<? super T> booleanFunction,
R target)
public static <T> com.gs.collections.api.list.primitive.MutableByteList collectByte(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ByteFunction<? super T> byteFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableByteCollection> R collectByte(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ByteFunction<? super T> byteFunction,
R target)
public static <T> com.gs.collections.api.list.primitive.MutableCharList collectChar(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.CharFunction<? super T> charFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableCharCollection> R collectChar(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.CharFunction<? super T> charFunction,
R target)
public static <T> com.gs.collections.api.list.primitive.MutableDoubleList collectDouble(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.DoubleFunction<? super T> doubleFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableDoubleCollection> R collectDouble(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.DoubleFunction<? super T> doubleFunction,
R target)
public static <T> com.gs.collections.api.list.primitive.MutableFloatList collectFloat(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.FloatFunction<? super T> floatFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableFloatCollection> R collectFloat(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.FloatFunction<? super T> floatFunction,
R target)
public static <T> com.gs.collections.api.list.primitive.MutableIntList collectInt(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.IntFunction<? super T> intFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableIntCollection> R collectInt(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.IntFunction<? super T> intFunction,
R target)
public static <T> com.gs.collections.api.list.primitive.MutableLongList collectLong(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.LongFunction<? super T> longFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableLongCollection> R collectLong(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.LongFunction<? super T> longFunction,
R target)
public static <T> com.gs.collections.api.list.primitive.MutableShortList collectShort(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ShortFunction<? super T> shortFunction)
public static <T,R extends com.gs.collections.api.collection.primitive.MutableShortCollection> R collectShort(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.ShortFunction<? super T> shortFunction,
R target)
public static <T,A,R extends java.util.Collection<A>> R collect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends A> function,
R targetCollection)
public static <T,A> java.util.ArrayList<A> flatCollect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<A>> function)
public static <T,A,R extends java.util.Collection<A>> R flatCollect(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<A>> function,
R targetCollection)
public static <T> void forEach(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.Procedure<? super T> procedure)
Iterate.forEach(Iterable, Procedure)public static <T> void reverseForEach(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.Procedure<? super T> procedure)
public static <T> void forEach(java.util.ArrayList<T> list,
int from,
int to,
com.gs.collections.api.block.procedure.Procedure<? super T> procedure)
e.g. ArrayListThis code would output ted and mary's names.people = new ArrayList (FastList.newListWith(ted, mary, bob, sally)); ArrayListIterate.forEach(people, 0, 1, new Procedure () { public void value(Person person) { LOGGER.info(person.getName()); } });
public static <T> void forEachWithIndex(java.util.ArrayList<T> list,
int from,
int to,
com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super T> objectIntProcedure)
e.g. ArrayListThis code would output ted and mary's names.people = new ArrayList (FastList.newListWith(ted, mary, bob, sally)); ArrayListIterate.forEachWithIndex(people, 0, 1, new ObjectIntProcedure () { public void value(Person person, int index) { LOGGER.info(person.getName() + " at index: " + index); } });
public static <T1,T2> void forEachInBoth(java.util.ArrayList<T1> list1,
java.util.ArrayList<T2> list2,
com.gs.collections.api.block.procedure.Procedure2<? super T1,? super T2> procedure)
public static <T> void forEachWithIndex(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.primitive.ObjectIntProcedure<? super T> objectIntProcedure)
public static <T> T detect(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
Iterate.detect(Iterable, Predicate)public static <T,P> T detectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter)
public static <T> T detectIfNone(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate,
T ifNone)
public static <T,IV> T detectWithIfNone(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue,
T ifNone)
public static <T,IV> IV injectInto(IV injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function2<? super IV,? super T,? extends IV> function)
public static <T> int injectInto(int injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.IntObjectToIntFunction<? super T> function)
public static <T> long injectInto(long injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.LongObjectToLongFunction<? super T> function)
public static <T> double injectInto(double injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.DoubleObjectToDoubleFunction<? super T> function)
public static <T> float injectInto(float injectValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.primitive.FloatObjectToFloatFunction<? super T> function)
public static <T> boolean anySatisfy(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T,P> boolean anySatisfyWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter)
public static <T> boolean allSatisfy(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T,IV> boolean allSatisfyWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue)
public static <T> boolean noneSatisfy(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T,IV> boolean noneSatisfyWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super IV> predicate,
IV injectedValue)
public static <T,P> com.gs.collections.api.tuple.Twin<com.gs.collections.api.list.MutableList<T>> selectAndRejectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter)
public static <T> com.gs.collections.api.partition.list.PartitionMutableList<T> partition(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T,P> com.gs.collections.api.partition.list.PartitionMutableList<T> partitionWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter)
public static <T> int detectIndex(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T,P> int detectIndexWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter)
public static <T,IV,P> IV injectIntoWith(IV injectedValue,
java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function3<? super IV,? super T,? super P,? extends IV> function,
P parameter)
public static <T,P> void forEachWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.procedure.Procedure2<? super T,? super P> procedure,
P parameter)
public static <T,P,A> java.util.ArrayList<A> collectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function2<? super T,? super P,? extends A> function,
P parameter)
public static <T,P,A,R extends java.util.Collection<A>> R collectWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function2<? super T,? super P,? extends A> function,
P parameter,
R targetCollection)
public static <T> java.util.ArrayList<T> removeIf(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T,P> java.util.ArrayList<T> removeIfWith(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate2<? super T,? super P> predicate,
P parameter)
public static <T> java.util.ArrayList<T> distinct(java.util.ArrayList<T> list)
public static <T,R extends java.util.Collection<T>> R distinct(java.util.ArrayList<T> list,
R targetCollection)
public static <T extends java.lang.Comparable<? super T>> java.util.ArrayList<T> sortThis(java.util.ArrayList<T> list)
public static <T> java.util.ArrayList<T> sortThis(java.util.ArrayList<T> list,
java.util.Comparator<? super T> comparator)
public static <T> void toArray(java.util.ArrayList<T> list,
T[] target,
int startIndex,
int sourceSize)
public static <T> java.util.ArrayList<T> take(java.util.ArrayList<T> list,
int count)
Iterate.take(Iterable, int)public static <T,R extends java.util.Collection<T>> R take(java.util.ArrayList<T> list,
int count,
R targetList)
Iterate.take(Iterable, int)public static <T> java.util.ArrayList<T> drop(java.util.ArrayList<T> list,
int count)
Iterate.drop(Iterable, int)public static <T,R extends java.util.Collection<T>> R drop(java.util.ArrayList<T> list,
int count,
R targetList)
Iterate.drop(Iterable, int)public static <T,V> FastListMultimap<V,T> groupBy(java.util.ArrayList<T> list, com.gs.collections.api.block.function.Function<? super T,? extends V> function)
Iterate.groupBy(Iterable, Function)public static <T,V,R extends com.gs.collections.api.multimap.MutableMultimap<V,T>> R groupBy(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends V> function,
R target)
public static <T,V> FastListMultimap<V,T> groupByEach(java.util.ArrayList<T> list, com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<V>> function)
public static <T,V,R extends com.gs.collections.api.multimap.MutableMultimap<V,T>> R groupByEach(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends java.lang.Iterable<V>> function,
R target)
public static <X,Y> com.gs.collections.api.list.MutableList<com.gs.collections.api.tuple.Pair<X,Y>> zip(java.util.ArrayList<X> xs,
java.lang.Iterable<Y> ys)
Iterate.zip(Iterable, Iterable)public static <X,Y,R extends java.util.Collection<com.gs.collections.api.tuple.Pair<X,Y>>> R zip(java.util.ArrayList<X> xs,
java.lang.Iterable<Y> ys,
R targetCollection)
public static <T> com.gs.collections.api.list.MutableList<com.gs.collections.api.tuple.Pair<T,java.lang.Integer>> zipWithIndex(java.util.ArrayList<T> list)
Iterate.zipWithIndex(Iterable)public static <T,R extends java.util.Collection<com.gs.collections.api.tuple.Pair<T,java.lang.Integer>>> R zipWithIndex(java.util.ArrayList<T> list,
R targetCollection)
public static <T> com.gs.collections.api.list.MutableList<T> takeWhile(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T> com.gs.collections.api.list.MutableList<T> dropWhile(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T> com.gs.collections.api.partition.list.PartitionMutableList<T> partitionWhile(java.util.ArrayList<T> list,
com.gs.collections.api.block.predicate.Predicate<? super T> predicate)
public static <T,K,V> com.gs.collections.api.map.MutableMap<K,V> aggregateInPlaceBy(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends K> groupBy,
com.gs.collections.api.block.function.Function0<? extends V> zeroValueFactory,
com.gs.collections.api.block.procedure.Procedure2<? super V,? super T> mutatingAggregator)
public static <T,K,V> com.gs.collections.api.map.MutableMap<K,V> aggregateBy(java.util.ArrayList<T> list,
com.gs.collections.api.block.function.Function<? super T,? extends K> groupBy,
com.gs.collections.api.block.function.Function0<? extends V> zeroValueFactory,
com.gs.collections.api.block.function.Function2<? super V,? super T,? extends V> nonMutatingAggregator)