Class AbstractMultiReaderMutableCollection<T>
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.AbstractMultiReaderMutableCollection<T>
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,MutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
- Direct Known Subclasses:
MultiReaderFastList
,MultiReaderHashBag
,MultiReaderUnifiedSet
public abstract class AbstractMultiReaderMutableCollection<T> extends Object implements MutableCollection<T>
AbstractMultiReaderMutableCollection is an abstraction that provides thread-safe collection behaviors. Subclasses of this class must provide implementations of getDelegate() and getLock().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractMultiReaderMutableCollection.LockWrapper
static class
AbstractMultiReaderMutableCollection.ReadWriteLockWrapper
-
Constructor Summary
Constructors Constructor Description AbstractMultiReaderMutableCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T item)
boolean
addAll(Collection<? extends T> collection)
boolean
addAllIterable(Iterable<? extends T> iterable)
<K,V>
MutableMap<K,V>aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)
boolean
allSatisfy(Predicate<? super T> predicate)
<P> boolean
allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
anySatisfy(Predicate<? super T> predicate)
<P> boolean
anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
void
appendString(Appendable appendable)
void
appendString(Appendable appendable, String separator)
void
appendString(Appendable appendable, String start, String separator, String end)
LazyIterable<T>
asLazy()
void
clear()
<V,R extends Collection<V>>
Rcollect(Function<? super T,? extends V> function, R target)
<R extends MutableBooleanCollection>
RcollectBoolean(BooleanFunction<? super T> booleanFunction, R target)
<R extends MutableByteCollection>
RcollectByte(ByteFunction<? super T> byteFunction, R target)
<R extends MutableCharCollection>
RcollectChar(CharFunction<? super T> charFunction, R target)
<R extends MutableDoubleCollection>
RcollectDouble(DoubleFunction<? super T> doubleFunction, R target)
<R extends MutableFloatCollection>
RcollectFloat(FloatFunction<? super T> floatFunction, R target)
<V,R extends Collection<V>>
RcollectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function, R target)
<R extends MutableIntCollection>
RcollectInt(IntFunction<? super T> intFunction, R target)
<R extends MutableLongCollection>
RcollectLong(LongFunction<? super T> longFunction, R target)
<R extends MutableShortCollection>
RcollectShort(ShortFunction<? super T> shortFunction, R target)
<P,V,R extends Collection<V>>
RcollectWith(Function2<? super T,? super P,? extends V> function, P parameter, R targetCollection)
boolean
contains(Object item)
boolean
containsAll(Collection<?> collection)
boolean
containsAllArguments(Object... elements)
boolean
containsAllIterable(Iterable<?> source)
int
count(Predicate<? super T> predicate)
<P> int
countWith(Predicate2<? super T,? super P> predicate, P parameter)
T
detect(Predicate<? super T> predicate)
T
detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
Optional<T>
detectOptional(Predicate<? super T> predicate)
<P> T
detectWith(Predicate2<? super T,? super P> predicate, P parameter)
<P> T
detectWithIfNone(Predicate2<? super T,? super P> predicate, P parameter, Function0<? extends T> function)
<P> Optional<T>
detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
void
each(Procedure<? super T> procedure)
<V,R extends Collection<V>>
RflatCollect(Function<? super T,? extends Iterable<V>> function, R target)
<R extends MutableBooleanCollection>
RflatCollectBoolean(Function<? super T,? extends BooleanIterable> function, R target)
<R extends MutableByteCollection>
RflatCollectByte(Function<? super T,? extends ByteIterable> function, R target)
<R extends MutableCharCollection>
RflatCollectChar(Function<? super T,? extends CharIterable> function, R target)
<R extends MutableDoubleCollection>
RflatCollectDouble(Function<? super T,? extends DoubleIterable> function, R target)
<R extends MutableFloatCollection>
RflatCollectFloat(Function<? super T,? extends FloatIterable> function, R target)
<R extends MutableIntCollection>
RflatCollectInt(Function<? super T,? extends IntIterable> function, R target)
<R extends MutableLongCollection>
RflatCollectLong(Function<? super T,? extends LongIterable> function, R target)
<R extends MutableShortCollection>
RflatCollectShort(Function<? super T,? extends ShortIterable> function, R target)
<P> void
forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
void
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
T
getFirst()
T
getLast()
T
getOnly()
<V,R extends MutableMultimap<V,T>>
RgroupBy(Function<? super T,? extends V> function, R target)
<V,R extends MutableMultimap<V,T>>
RgroupByEach(Function<? super T,? extends Iterable<V>> function, R target)
<V,R extends MutableMapIterable<V,T>>
RgroupByUniqueKey(Function<? super T,? extends V> function, R target)
double
injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)
float
injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function)
int
injectInto(int injectedValue, IntObjectToIntFunction<? super T> function)
long
injectInto(long injectedValue, LongObjectToLongFunction<? super T> function)
<IV> IV
injectInto(IV injectedValue, Function2<? super IV,? super T,? extends IV> function)
<IV,P>
IVinjectIntoWith(IV injectValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)
<R extends Collection<T>>
Rinto(R target)
boolean
isEmpty()
Iterator<T>
iterator()
This method is not supported directly on MultiReader collections because it is not thread-safe.String
makeString()
String
makeString(String separator)
String
makeString(String start, String separator, String end)
String
makeString(Function<? super T,Object> function, String start, String separator, String end)
T
max()
T
max(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
TmaxBy(Function<? super T,? extends V> function)
<V extends Comparable<? super V>>
Optional<T>maxByOptional(Function<? super T,? extends V> function)
Optional<T>
maxOptional()
Optional<T>
maxOptional(Comparator<? super T> comparator)
T
min()
T
min(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
TminBy(Function<? super T,? extends V> function)
<V extends Comparable<? super V>>
Optional<T>minByOptional(Function<? super T,? extends V> function)
Optional<T>
minOptional()
Optional<T>
minOptional(Comparator<? super T> comparator)
boolean
noneSatisfy(Predicate<? super T> predicate)
<P> boolean
noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
notEmpty()
Stream<T>
parallelStream()
This method is not supported directly on MultiReader collections because it is not thread-safe.<R extends Collection<T>>
Rreject(Predicate<? super T> predicate, R target)
<P,R extends Collection<T>>
RrejectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)
boolean
remove(Object item)
boolean
removeAll(Collection<?> collection)
boolean
removeAllIterable(Iterable<?> iterable)
boolean
removeIf(Predicate<? super T> predicate)
<P> boolean
removeIfWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
retainAll(Collection<?> collection)
boolean
retainAllIterable(Iterable<?> iterable)
<R extends Collection<T>>
Rselect(Predicate<? super T> predicate, R target)
<P> Twin<MutableList<T>>
selectAndRejectWith(Predicate2<? super T,? super P> predicate, P parameter)
<P,R extends Collection<T>>
RselectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)
int
size()
Spliterator<T>
spliterator()
This method is not supported directly on MultiReader collections because it is not thread-safe.Stream<T>
stream()
This method is not supported directly on MultiReader collections because it is not thread-safe.<V> MutableObjectDoubleMap<V>
sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
<V> MutableObjectDoubleMap<V>
sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
<V> MutableObjectLongMap<V>
sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
<V> MutableObjectLongMap<V>
sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
double
sumOfDouble(DoubleFunction<? super T> function)
double
sumOfFloat(FloatFunction<? super T> function)
long
sumOfInt(IntFunction<? super T> function)
long
sumOfLong(LongFunction<? super T> function)
Object[]
toArray()
<E> E[]
toArray(E[] a)
MutableBag<T>
toBag()
<NK,NV>
MutableBiMap<NK,NV>toBiMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
ImmutableBag<T>
toImmutableBag()
ImmutableList<T>
toImmutableList()
ImmutableSet<T>
toImmutableSet()
ImmutableSortedBag<T>
toImmutableSortedBag()
ImmutableSortedBag<T>
toImmutableSortedBag(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
ImmutableSortedBag<T>toImmutableSortedBagBy(Function<? super T,? extends V> function)
ImmutableList<T>
toImmutableSortedList()
ImmutableList<T>
toImmutableSortedList(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
ImmutableList<T>toImmutableSortedListBy(Function<? super T,? extends V> function)
ImmutableSortedSet<T>
toImmutableSortedSet()
ImmutableSortedSet<T>
toImmutableSortedSet(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
ImmutableSortedSet<T>toImmutableSortedSetBy(Function<? super T,? extends V> function)
MutableList<T>
toList()
<K,V,R extends Map<K,V>>
RtoMap(Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction, R target)
<NK,NV>
MutableMap<NK,NV>toMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
MutableSet<T>
toSet()
MutableSortedBag<T>
toSortedBag()
MutableSortedBag<T>
toSortedBag(Comparator<? super T> comparator)
MutableList<T>
toSortedList()
MutableList<T>
toSortedList(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
MutableList<T>toSortedListBy(Function<? super T,? extends V> function)
<NK,NV>
MutableSortedMap<NK,NV>toSortedMap(Comparator<? super NK> comparator, Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
<NK,NV>
MutableSortedMap<NK,NV>toSortedMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
MutableSortedSet<T>
toSortedSet()
MutableSortedSet<T>
toSortedSet(Comparator<? super T> comparator)
<V extends Comparable<? super V>>
MutableSortedSet<T>toSortedSetBy(Function<? super T,? extends V> function)
String
toString()
<S,R extends Collection<Pair<T,S>>>
Rzip(Iterable<S> that, R target)
<R extends Collection<Pair<T,Integer>>>
RzipWithIndex(R target)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, removeIf, toArray
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach
-
Methods inherited from interface org.eclipse.collections.api.collection.MutableCollection
aggregateBy, asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, countBy, countByEach, countByWith, flatCollect, flatCollectWith, groupBy, groupByEach, groupByUniqueKey, newEmpty, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, toImmutable, with, withAll, without, withoutAll, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, chunk, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, countBy, countByEach, countByWith, flatCollectWith, forEach, getAny, groupByAndCollect, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, reduce, reduceInPlace, reduceInPlace, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, toImmutableBiMap, toImmutableMap, toSortedBagBy, toSortedMapBy
-
-
-
-
Method Detail
-
contains
public boolean contains(Object item)
- Specified by:
contains
in interfaceCollection<T>
- Specified by:
contains
in interfaceRichIterable<T>
-
containsAll
public boolean containsAll(Collection<?> collection)
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceRichIterable<T>
-
containsAllIterable
public boolean containsAllIterable(Iterable<?> source)
- Specified by:
containsAllIterable
in interfaceRichIterable<T>
-
containsAllArguments
public boolean containsAllArguments(Object... elements)
- Specified by:
containsAllArguments
in interfaceRichIterable<T>
-
noneSatisfy
public boolean noneSatisfy(Predicate<? super T> predicate)
- Specified by:
noneSatisfy
in interfaceRichIterable<T>
-
noneSatisfyWith
public <P> boolean noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
noneSatisfyWith
in interfaceRichIterable<T>
-
allSatisfy
public boolean allSatisfy(Predicate<? super T> predicate)
- Specified by:
allSatisfy
in interfaceRichIterable<T>
-
allSatisfyWith
public <P> boolean allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
allSatisfyWith
in interfaceRichIterable<T>
-
anySatisfy
public boolean anySatisfy(Predicate<? super T> predicate)
- Specified by:
anySatisfy
in interfaceRichIterable<T>
-
anySatisfyWith
public <P> boolean anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
anySatisfyWith
in interfaceRichIterable<T>
-
into
public <R extends Collection<T>> R into(R target)
- Specified by:
into
in interfaceRichIterable<T>
-
toList
public MutableList<T> toList()
- Specified by:
toList
in interfaceRichIterable<T>
-
toImmutableList
public ImmutableList<T> toImmutableList()
- Specified by:
toImmutableList
in interfaceRichIterable<T>
-
toMap
public <NK,NV> MutableMap<NK,NV> toMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toMap
in interfaceRichIterable<T>
-
toMap
public <K,V,R extends Map<K,V>> R toMap(Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction, R target)
- Specified by:
toMap
in interfaceRichIterable<T>
-
toSortedMap
public <NK,NV> MutableSortedMap<NK,NV> toSortedMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toSortedMap
in interfaceRichIterable<T>
-
toSortedMap
public <NK,NV> MutableSortedMap<NK,NV> toSortedMap(Comparator<? super NK> comparator, Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toSortedMap
in interfaceRichIterable<T>
-
toBiMap
public <NK,NV> MutableBiMap<NK,NV> toBiMap(Function<? super T,? extends NK> keyFunction, Function<? super T,? extends NV> valueFunction)
- Specified by:
toBiMap
in interfaceRichIterable<T>
-
asLazy
public LazyIterable<T> asLazy()
- Specified by:
asLazy
in interfaceRichIterable<T>
-
toSet
public MutableSet<T> toSet()
- Specified by:
toSet
in interfaceRichIterable<T>
-
toImmutableSet
public ImmutableSet<T> toImmutableSet()
- Specified by:
toImmutableSet
in interfaceRichIterable<T>
-
toBag
public MutableBag<T> toBag()
- Specified by:
toBag
in interfaceRichIterable<T>
-
toImmutableBag
public ImmutableBag<T> toImmutableBag()
- Specified by:
toImmutableBag
in interfaceRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag()
- Specified by:
toSortedBag
in interfaceRichIterable<T>
-
toImmutableSortedBag
public ImmutableSortedBag<T> toImmutableSortedBag()
- Specified by:
toImmutableSortedBag
in interfaceRichIterable<T>
-
toSortedBag
public MutableSortedBag<T> toSortedBag(Comparator<? super T> comparator)
- Specified by:
toSortedBag
in interfaceRichIterable<T>
-
toImmutableSortedBag
public ImmutableSortedBag<T> toImmutableSortedBag(Comparator<? super T> comparator)
- Specified by:
toImmutableSortedBag
in interfaceRichIterable<T>
-
toImmutableSortedBagBy
public <V extends Comparable<? super V>> ImmutableSortedBag<T> toImmutableSortedBagBy(Function<? super T,? extends V> function)
- Specified by:
toImmutableSortedBagBy
in interfaceRichIterable<T>
-
toSortedList
public MutableList<T> toSortedList()
- Specified by:
toSortedList
in interfaceRichIterable<T>
-
toImmutableSortedList
public ImmutableList<T> toImmutableSortedList()
- Specified by:
toImmutableSortedList
in interfaceRichIterable<T>
-
toSortedList
public MutableList<T> toSortedList(Comparator<? super T> comparator)
- Specified by:
toSortedList
in interfaceRichIterable<T>
-
toImmutableSortedList
public ImmutableList<T> toImmutableSortedList(Comparator<? super T> comparator)
- Specified by:
toImmutableSortedList
in interfaceRichIterable<T>
-
toSortedListBy
public <V extends Comparable<? super V>> MutableList<T> toSortedListBy(Function<? super T,? extends V> function)
- Specified by:
toSortedListBy
in interfaceRichIterable<T>
-
toImmutableSortedListBy
public <V extends Comparable<? super V>> ImmutableList<T> toImmutableSortedListBy(Function<? super T,? extends V> function)
- Specified by:
toImmutableSortedListBy
in interfaceRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet()
- Specified by:
toSortedSet
in interfaceRichIterable<T>
-
toImmutableSortedSet
public ImmutableSortedSet<T> toImmutableSortedSet()
- Specified by:
toImmutableSortedSet
in interfaceRichIterable<T>
-
toSortedSet
public MutableSortedSet<T> toSortedSet(Comparator<? super T> comparator)
- Specified by:
toSortedSet
in interfaceRichIterable<T>
-
toImmutableSortedSet
public ImmutableSortedSet<T> toImmutableSortedSet(Comparator<? super T> comparator)
- Specified by:
toImmutableSortedSet
in interfaceRichIterable<T>
-
toSortedSetBy
public <V extends Comparable<? super V>> MutableSortedSet<T> toSortedSetBy(Function<? super T,? extends V> function)
- Specified by:
toSortedSetBy
in interfaceRichIterable<T>
-
toImmutableSortedSetBy
public <V extends Comparable<? super V>> ImmutableSortedSet<T> toImmutableSortedSetBy(Function<? super T,? extends V> function)
- Specified by:
toImmutableSortedSetBy
in interfaceRichIterable<T>
-
count
public int count(Predicate<? super T> predicate)
- Specified by:
count
in interfaceRichIterable<T>
-
countWith
public <P> int countWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
countWith
in interfaceRichIterable<T>
-
detect
public T detect(Predicate<? super T> predicate)
- Specified by:
detect
in interfaceRichIterable<T>
-
detectWith
public <P> T detectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWith
in interfaceRichIterable<T>
-
detectOptional
public Optional<T> detectOptional(Predicate<? super T> predicate)
- Specified by:
detectOptional
in interfaceRichIterable<T>
-
detectWithOptional
public <P> Optional<T> detectWithOptional(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
detectWithOptional
in interfaceRichIterable<T>
-
detectIfNone
public T detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
- Specified by:
detectIfNone
in interfaceRichIterable<T>
-
detectWithIfNone
public <P> T detectWithIfNone(Predicate2<? super T,? super P> predicate, P parameter, Function0<? extends T> function)
- Specified by:
detectWithIfNone
in interfaceRichIterable<T>
-
min
public T min(Comparator<? super T> comparator)
- Specified by:
min
in interfaceRichIterable<T>
-
max
public T max(Comparator<? super T> comparator)
- Specified by:
max
in interfaceRichIterable<T>
-
minOptional
public Optional<T> minOptional(Comparator<? super T> comparator)
- Specified by:
minOptional
in interfaceRichIterable<T>
-
maxOptional
public Optional<T> maxOptional(Comparator<? super T> comparator)
- Specified by:
maxOptional
in interfaceRichIterable<T>
-
min
public T min()
- Specified by:
min
in interfaceRichIterable<T>
-
max
public T max()
- Specified by:
max
in interfaceRichIterable<T>
-
minOptional
public Optional<T> minOptional()
- Specified by:
minOptional
in interfaceRichIterable<T>
-
maxOptional
public Optional<T> maxOptional()
- Specified by:
maxOptional
in interfaceRichIterable<T>
-
minBy
public <V extends Comparable<? super V>> T minBy(Function<? super T,? extends V> function)
- Specified by:
minBy
in interfaceRichIterable<T>
-
maxBy
public <V extends Comparable<? super V>> T maxBy(Function<? super T,? extends V> function)
- Specified by:
maxBy
in interfaceRichIterable<T>
-
minByOptional
public <V extends Comparable<? super V>> Optional<T> minByOptional(Function<? super T,? extends V> function)
- Specified by:
minByOptional
in interfaceRichIterable<T>
-
maxByOptional
public <V extends Comparable<? super V>> Optional<T> maxByOptional(Function<? super T,? extends V> function)
- Specified by:
maxByOptional
in interfaceRichIterable<T>
-
getFirst
public T getFirst()
- Specified by:
getFirst
in interfaceRichIterable<T>
-
getLast
public T getLast()
- Specified by:
getLast
in interfaceRichIterable<T>
-
getOnly
public T getOnly()
- Specified by:
getOnly
in interfaceRichIterable<T>
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmpty
in interfaceRichIterable<T>
-
selectAndRejectWith
public <P> Twin<MutableList<T>> selectAndRejectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
selectAndRejectWith
in interfaceMutableCollection<T>
-
collect
public <V,R extends Collection<V>> R collect(Function<? super T,? extends V> function, R target)
- Specified by:
collect
in interfaceRichIterable<T>
-
collectBoolean
public <R extends MutableBooleanCollection> R collectBoolean(BooleanFunction<? super T> booleanFunction, R target)
- Specified by:
collectBoolean
in interfaceRichIterable<T>
-
flatCollectBoolean
public <R extends MutableBooleanCollection> R flatCollectBoolean(Function<? super T,? extends BooleanIterable> function, R target)
- Specified by:
flatCollectBoolean
in interfaceRichIterable<T>
-
collectByte
public <R extends MutableByteCollection> R collectByte(ByteFunction<? super T> byteFunction, R target)
- Specified by:
collectByte
in interfaceRichIterable<T>
-
flatCollectByte
public <R extends MutableByteCollection> R flatCollectByte(Function<? super T,? extends ByteIterable> function, R target)
- Specified by:
flatCollectByte
in interfaceRichIterable<T>
-
collectChar
public <R extends MutableCharCollection> R collectChar(CharFunction<? super T> charFunction, R target)
- Specified by:
collectChar
in interfaceRichIterable<T>
-
flatCollectChar
public <R extends MutableCharCollection> R flatCollectChar(Function<? super T,? extends CharIterable> function, R target)
- Specified by:
flatCollectChar
in interfaceRichIterable<T>
-
collectDouble
public <R extends MutableDoubleCollection> R collectDouble(DoubleFunction<? super T> doubleFunction, R target)
- Specified by:
collectDouble
in interfaceRichIterable<T>
-
flatCollectDouble
public <R extends MutableDoubleCollection> R flatCollectDouble(Function<? super T,? extends DoubleIterable> function, R target)
- Specified by:
flatCollectDouble
in interfaceRichIterable<T>
-
collectFloat
public <R extends MutableFloatCollection> R collectFloat(FloatFunction<? super T> floatFunction, R target)
- Specified by:
collectFloat
in interfaceRichIterable<T>
-
flatCollectFloat
public <R extends MutableFloatCollection> R flatCollectFloat(Function<? super T,? extends FloatIterable> function, R target)
- Specified by:
flatCollectFloat
in interfaceRichIterable<T>
-
collectInt
public <R extends MutableIntCollection> R collectInt(IntFunction<? super T> intFunction, R target)
- Specified by:
collectInt
in interfaceRichIterable<T>
-
flatCollectInt
public <R extends MutableIntCollection> R flatCollectInt(Function<? super T,? extends IntIterable> function, R target)
- Specified by:
flatCollectInt
in interfaceRichIterable<T>
-
collectLong
public <R extends MutableLongCollection> R collectLong(LongFunction<? super T> longFunction, R target)
- Specified by:
collectLong
in interfaceRichIterable<T>
-
flatCollectLong
public <R extends MutableLongCollection> R flatCollectLong(Function<? super T,? extends LongIterable> function, R target)
- Specified by:
flatCollectLong
in interfaceRichIterable<T>
-
collectShort
public <R extends MutableShortCollection> R collectShort(ShortFunction<? super T> shortFunction, R target)
- Specified by:
collectShort
in interfaceRichIterable<T>
-
flatCollectShort
public <R extends MutableShortCollection> R flatCollectShort(Function<? super T,? extends ShortIterable> function, R target)
- Specified by:
flatCollectShort
in interfaceRichIterable<T>
-
flatCollect
public <V,R extends Collection<V>> R flatCollect(Function<? super T,? extends Iterable<V>> function, R target)
- Specified by:
flatCollect
in interfaceRichIterable<T>
-
collectIf
public <V,R extends Collection<V>> R collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function, R target)
- Specified by:
collectIf
in interfaceRichIterable<T>
-
collectWith
public <P,V,R extends Collection<V>> R collectWith(Function2<? super T,? super P,? extends V> function, P parameter, R targetCollection)
- Specified by:
collectWith
in interfaceRichIterable<T>
-
selectWith
public <P,R extends Collection<T>> R selectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)
- Specified by:
selectWith
in interfaceRichIterable<T>
-
reject
public <R extends Collection<T>> R reject(Predicate<? super T> predicate, R target)
- Specified by:
reject
in interfaceRichIterable<T>
-
rejectWith
public <P,R extends Collection<T>> R rejectWith(Predicate2<? super T,? super P> predicate, P parameter, R targetCollection)
- Specified by:
rejectWith
in interfaceRichIterable<T>
-
select
public <R extends Collection<T>> R select(Predicate<? super T> predicate, R target)
- Specified by:
select
in interfaceRichIterable<T>
-
injectInto
public <IV> IV injectInto(IV injectedValue, Function2<? super IV,? super T,? extends IV> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
-
injectInto
public int injectInto(int injectedValue, IntObjectToIntFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
-
injectInto
public long injectInto(long injectedValue, LongObjectToLongFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
-
injectInto
public double injectInto(double injectedValue, DoubleObjectToDoubleFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
-
injectInto
public float injectInto(float injectedValue, FloatObjectToFloatFunction<? super T> function)
- Specified by:
injectInto
in interfaceRichIterable<T>
-
sumOfInt
public long sumOfInt(IntFunction<? super T> function)
- Specified by:
sumOfInt
in interfaceRichIterable<T>
-
sumOfFloat
public double sumOfFloat(FloatFunction<? super T> function)
- Specified by:
sumOfFloat
in interfaceRichIterable<T>
-
sumOfLong
public long sumOfLong(LongFunction<? super T> function)
- Specified by:
sumOfLong
in interfaceRichIterable<T>
-
sumOfDouble
public double sumOfDouble(DoubleFunction<? super T> function)
- Specified by:
sumOfDouble
in interfaceRichIterable<T>
-
sumByInt
public <V> MutableObjectLongMap<V> sumByInt(Function<? super T,? extends V> groupBy, IntFunction<? super T> function)
- Specified by:
sumByInt
in interfaceMutableCollection<T>
- Specified by:
sumByInt
in interfaceRichIterable<T>
-
sumByFloat
public <V> MutableObjectDoubleMap<V> sumByFloat(Function<? super T,? extends V> groupBy, FloatFunction<? super T> function)
- Specified by:
sumByFloat
in interfaceMutableCollection<T>
- Specified by:
sumByFloat
in interfaceRichIterable<T>
-
sumByLong
public <V> MutableObjectLongMap<V> sumByLong(Function<? super T,? extends V> groupBy, LongFunction<? super T> function)
- Specified by:
sumByLong
in interfaceMutableCollection<T>
- Specified by:
sumByLong
in interfaceRichIterable<T>
-
sumByDouble
public <V> MutableObjectDoubleMap<V> sumByDouble(Function<? super T,? extends V> groupBy, DoubleFunction<? super T> function)
- Specified by:
sumByDouble
in interfaceMutableCollection<T>
- Specified by:
sumByDouble
in interfaceRichIterable<T>
-
injectIntoWith
public <IV,P> IV injectIntoWith(IV injectValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)
- Specified by:
injectIntoWith
in interfaceMutableCollection<T>
-
removeIf
public boolean removeIf(Predicate<? super T> predicate)
- Specified by:
removeIf
in interfaceMutableCollection<T>
-
removeIfWith
public <P> boolean removeIfWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
removeIfWith
in interfaceMutableCollection<T>
-
add
public boolean add(T item)
- Specified by:
add
in interfaceCollection<T>
-
addAll
public boolean addAll(Collection<? extends T> collection)
- Specified by:
addAll
in interfaceCollection<T>
-
addAllIterable
public boolean addAllIterable(Iterable<? extends T> iterable)
- Specified by:
addAllIterable
in interfaceMutableCollection<T>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<T>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<T>
- Specified by:
isEmpty
in interfaceRichIterable<T>
-
iterator
public Iterator<T> iterator()
This method is not supported directly on MultiReader collections because it is not thread-safe. If you would like to use an iterator with a MultiReader collection, then you must do the following:multiReaderList.withReadLockAndDelegate(MutableList<Person> -> { Iterator it = people.iterator(); .... });
final Collection jdkSet = new HashSet(); final boolean containsAll = new boolean[1]; multiReaderList.withReadLockAndDelegate(MutableList<Person> people -> { set.addAll(people); // addAll uses iterator() in AbstractCollection containsAll[0] = set.containsAll(people); // containsAll uses iterator() in AbstractCollection });
-
spliterator
public Spliterator<T> spliterator()
This method is not supported directly on MultiReader collections because it is not thread-safe. If you would like to use a spliterator with a MultiReader collection, then you must protect the calls by calling either withReadLockAndDelegate or withWriteLockAndDelegate.- Specified by:
spliterator
in interfaceCollection<T>
- Specified by:
spliterator
in interfaceIterable<T>
-
stream
public Stream<T> stream()
This method is not supported directly on MultiReader collections because it is not thread-safe. If you would like to use stream with a MultiReader collection, then you must protect the calls by calling either withReadLockAndDelegate or withWriteLockAndDelegate.- Specified by:
stream
in interfaceCollection<T>
-
parallelStream
public Stream<T> parallelStream()
This method is not supported directly on MultiReader collections because it is not thread-safe. If you would like to use parallelStream with a MultiReader collection, then you must protect the calls by calling either withReadLockAndDelegate or withWriteLockAndDelegate.- Specified by:
parallelStream
in interfaceCollection<T>
-
remove
public boolean remove(Object item)
- Specified by:
remove
in interfaceCollection<T>
-
removeAll
public boolean removeAll(Collection<?> collection)
- Specified by:
removeAll
in interfaceCollection<T>
-
removeAllIterable
public boolean removeAllIterable(Iterable<?> iterable)
- Specified by:
removeAllIterable
in interfaceMutableCollection<T>
-
retainAll
public boolean retainAll(Collection<?> collection)
- Specified by:
retainAll
in interfaceCollection<T>
-
retainAllIterable
public boolean retainAllIterable(Iterable<?> iterable)
- Specified by:
retainAllIterable
in interfaceMutableCollection<T>
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceRichIterable<T>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceRichIterable<T>
-
toArray
public <E> E[] toArray(E[] a)
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceRichIterable<T>
-
each
public void each(Procedure<? super T> procedure)
- Specified by:
each
in interfaceRichIterable<T>
-
forEachWith
public <P> void forEachWith(Procedure2<? super T,? super P> procedure, P parameter)
- Specified by:
forEachWith
in interfaceInternalIterable<T>
-
forEachWithIndex
public void forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
- Specified by:
forEachWithIndex
in interfaceInternalIterable<T>
-
toString
public String toString()
- Specified by:
toString
in interfaceRichIterable<T>
- Overrides:
toString
in classObject
-
makeString
public String makeString()
- Specified by:
makeString
in interfaceRichIterable<T>
-
makeString
public String makeString(String separator)
- Specified by:
makeString
in interfaceRichIterable<T>
-
makeString
public String makeString(String start, String separator, String end)
- Specified by:
makeString
in interfaceRichIterable<T>
-
makeString
public String makeString(Function<? super T,Object> function, String start, String separator, String end)
- Specified by:
makeString
in interfaceRichIterable<T>
-
appendString
public void appendString(Appendable appendable)
- Specified by:
appendString
in interfaceRichIterable<T>
-
appendString
public void appendString(Appendable appendable, String separator)
- Specified by:
appendString
in interfaceRichIterable<T>
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendString
in interfaceRichIterable<T>
-
groupBy
public <V,R extends MutableMultimap<V,T>> R groupBy(Function<? super T,? extends V> function, R target)
- Specified by:
groupBy
in interfaceRichIterable<T>
-
groupByEach
public <V,R extends MutableMultimap<V,T>> R groupByEach(Function<? super T,? extends Iterable<V>> function, R target)
- Specified by:
groupByEach
in interfaceRichIterable<T>
-
groupByUniqueKey
public <V,R extends MutableMapIterable<V,T>> R groupByUniqueKey(Function<? super T,? extends V> function, R target)
- Specified by:
groupByUniqueKey
in interfaceRichIterable<T>
-
zip
public <S,R extends Collection<Pair<T,S>>> R zip(Iterable<S> that, R target)
- Specified by:
zip
in interfaceRichIterable<T>
-
zipWithIndex
public <R extends Collection<Pair<T,Integer>>> R zipWithIndex(R target)
- Specified by:
zipWithIndex
in interfaceRichIterable<T>
-
aggregateInPlaceBy
public <K,V> MutableMap<K,V> aggregateInPlaceBy(Function<? super T,? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V,? super T> mutatingAggregator)
- Specified by:
aggregateInPlaceBy
in interfaceMutableCollection<T>
- Specified by:
aggregateInPlaceBy
in interfaceRichIterable<T>
-
-