public final class MultiReaderFastList<T> extends AbstractMultiReaderMutableCollection<T> implements RandomAccess, Externalizable, MultiReaderList<T>
iterator(), listIterator(), listIterator(int), or
get(int), as all these methods require an external lock to be taken to provide thread-safe iteration. All of
these methods are available however, if you use the withReadLockAndDelegate() or withWriteLockAndDelegate() methods.
Both of these methods take a parameter of type Procedure<MutableList>, and a wrapped version of the underlying
FastList is returned. This wrapper guarantees that no external pointer can ever reference the underlying FastList
outside a locked procedure. In the case of the read lock method, an Unmodifiable version of the collection is
offered, which will throw UnsupportedOperationExceptions on any write methods like add or remove.AbstractMultiReaderMutableCollection.LockWrapper, AbstractMultiReaderMutableCollection.ReadWriteLockWrapper| Constructor and Description |
|---|
MultiReaderFastList()
Deprecated.
Empty default constructor used for serialization.
|
add, addAll, addAllIterable, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, clear, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, forEachWith, forEachWithIndex, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoWith, into, isEmpty, iterator, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, parallelStream, reject, rejectWith, remove, removeAll, removeAllIterable, removeIf, removeIfWith, retainAll, retainAllIterable, select, selectAndRejectWith, selectWith, size, spliterator, stream, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableList, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexcollectWithIndex, flatCollectWith, rejectWithIndex, selectWithIndex, toImmutableList, with, withAll, without, withoutAlladdAllIterable, aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, injectIntoWith, removeAllIterable, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongadd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamgetFirst, getLastcollectWithIndex, forEachWithIndex, rejectWithIndex, selectWithIndexaggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, getAny, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, maxBy, maxByOptional, maxOptional, maxOptional, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toStringforEachWith@Deprecated public MultiReaderFastList()
public static <T> MultiReaderFastList<T> newList()
public static <T> MultiReaderFastList<T> newList(int capacity)
public static <T> MultiReaderFastList<T> newList(Iterable<? extends T> iterable)
public static <T> MultiReaderFastList<T> newListWith(T... elements)
public void withReadLockAndDelegate(Procedure<? super MutableList<T>> procedure)
withReadLockAndDelegate in interface MultiReaderList<T>public void withWriteLockAndDelegate(Procedure<? super MutableList<T>> procedure)
withWriteLockAndDelegate in interface MultiReaderList<T>public MutableList<T> asSynchronized()
asSynchronized in interface MutableCollection<T>asSynchronized in interface MutableList<T>public MutableList<T> asUnmodifiable()
asUnmodifiable in interface MutableCollection<T>asUnmodifiable in interface MutableList<T>public ImmutableList<T> toImmutable()
toImmutable in interface MutableCollection<T>toImmutable in interface ListIterable<T>toImmutable in interface MutableList<T>public MutableList<T> clone()
clone in interface MutableList<T>clone in class Objectpublic <V> MutableList<V> collect(Function<? super T,? extends V> function)
collect in interface MutableCollection<T>collect in interface ListIterable<T>collect in interface MutableList<T>collect in interface OrderedIterable<T>collect in interface ReversibleIterable<T>collect in interface RichIterable<T>public MutableBooleanList collectBoolean(BooleanFunction<? super T> booleanFunction)
collectBoolean in interface MutableCollection<T>collectBoolean in interface ListIterable<T>collectBoolean in interface MutableList<T>collectBoolean in interface OrderedIterable<T>collectBoolean in interface ReversibleIterable<T>collectBoolean in interface RichIterable<T>public MutableByteList collectByte(ByteFunction<? super T> byteFunction)
collectByte in interface MutableCollection<T>collectByte in interface ListIterable<T>collectByte in interface MutableList<T>collectByte in interface OrderedIterable<T>collectByte in interface ReversibleIterable<T>collectByte in interface RichIterable<T>public MutableCharList collectChar(CharFunction<? super T> charFunction)
collectChar in interface MutableCollection<T>collectChar in interface ListIterable<T>collectChar in interface MutableList<T>collectChar in interface OrderedIterable<T>collectChar in interface ReversibleIterable<T>collectChar in interface RichIterable<T>public MutableDoubleList collectDouble(DoubleFunction<? super T> doubleFunction)
collectDouble in interface MutableCollection<T>collectDouble in interface ListIterable<T>collectDouble in interface MutableList<T>collectDouble in interface OrderedIterable<T>collectDouble in interface ReversibleIterable<T>collectDouble in interface RichIterable<T>public MutableFloatList collectFloat(FloatFunction<? super T> floatFunction)
collectFloat in interface MutableCollection<T>collectFloat in interface ListIterable<T>collectFloat in interface MutableList<T>collectFloat in interface OrderedIterable<T>collectFloat in interface ReversibleIterable<T>collectFloat in interface RichIterable<T>public MutableIntList collectInt(IntFunction<? super T> intFunction)
collectInt in interface MutableCollection<T>collectInt in interface ListIterable<T>collectInt in interface MutableList<T>collectInt in interface OrderedIterable<T>collectInt in interface ReversibleIterable<T>collectInt in interface RichIterable<T>public MutableLongList collectLong(LongFunction<? super T> longFunction)
collectLong in interface MutableCollection<T>collectLong in interface ListIterable<T>collectLong in interface MutableList<T>collectLong in interface OrderedIterable<T>collectLong in interface ReversibleIterable<T>collectLong in interface RichIterable<T>public MutableShortList collectShort(ShortFunction<? super T> shortFunction)
collectShort in interface MutableCollection<T>collectShort in interface ListIterable<T>collectShort in interface MutableList<T>collectShort in interface OrderedIterable<T>collectShort in interface ReversibleIterable<T>collectShort in interface RichIterable<T>public <V> MutableList<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
flatCollect in interface MutableCollection<T>flatCollect in interface ListIterable<T>flatCollect in interface MutableList<T>flatCollect in interface OrderedIterable<T>flatCollect in interface ReversibleIterable<T>flatCollect in interface RichIterable<T>public <V> MutableList<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
collectIf in interface MutableCollection<T>collectIf in interface ListIterable<T>collectIf in interface MutableList<T>collectIf in interface OrderedIterable<T>collectIf in interface ReversibleIterable<T>collectIf in interface RichIterable<T>public <P,V> MutableList<V> collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
collectWith in interface MutableCollection<T>collectWith in interface ListIterable<T>collectWith in interface MutableList<T>collectWith in interface OrderedIterable<T>collectWith in interface ReversibleIterable<T>collectWith in interface RichIterable<T>public MutableList<T> newEmpty()
newEmpty in interface MutableCollection<T>newEmpty in interface MutableList<T>public MutableList<T> reject(Predicate<? super T> predicate)
reject in interface MutableCollection<T>reject in interface ListIterable<T>reject in interface MutableList<T>reject in interface OrderedIterable<T>reject in interface ReversibleIterable<T>reject in interface RichIterable<T>public <P> MutableList<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
rejectWith in interface MutableCollection<T>rejectWith in interface ListIterable<T>rejectWith in interface MutableList<T>rejectWith in interface OrderedIterable<T>rejectWith in interface ReversibleIterable<T>rejectWith in interface RichIterable<T>public MutableList<T> tap(Procedure<? super T> procedure)
tap in interface MutableCollection<T>tap in interface ListIterable<T>tap in interface MutableList<T>tap in interface OrderedIterable<T>tap in interface ReversibleIterable<T>tap in interface RichIterable<T>public MutableList<T> select(Predicate<? super T> predicate)
select in interface MutableCollection<T>select in interface ListIterable<T>select in interface MutableList<T>select in interface OrderedIterable<T>select in interface ReversibleIterable<T>select in interface RichIterable<T>public <P> MutableList<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
selectWith in interface MutableCollection<T>selectWith in interface ListIterable<T>selectWith in interface MutableList<T>selectWith in interface OrderedIterable<T>selectWith in interface ReversibleIterable<T>selectWith in interface RichIterable<T>public PartitionMutableList<T> partition(Predicate<? super T> predicate)
partition in interface MutableCollection<T>partition in interface ListIterable<T>partition in interface MutableList<T>partition in interface OrderedIterable<T>partition in interface ReversibleIterable<T>partition in interface RichIterable<T>public <P> PartitionMutableList<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
partitionWith in interface MutableCollection<T>partitionWith in interface ListIterable<T>partitionWith in interface MutableList<T>partitionWith in interface OrderedIterable<T>partitionWith in interface ReversibleIterable<T>partitionWith in interface RichIterable<T>public <S> MutableList<S> selectInstancesOf(Class<S> clazz)
selectInstancesOf in interface MutableCollection<T>selectInstancesOf in interface ListIterable<T>selectInstancesOf in interface MutableList<T>selectInstancesOf in interface OrderedIterable<T>selectInstancesOf in interface ReversibleIterable<T>selectInstancesOf in interface RichIterable<T>public MutableList<T> distinct()
distinct in interface ListIterable<T>distinct in interface MutableList<T>distinct in interface OrderedIterable<T>distinct in interface ReversibleIterable<T>public MutableList<T> distinct(HashingStrategy<? super T> hashingStrategy)
distinct in interface ListIterable<T>distinct in interface MutableList<T>public <V> MutableList<T> distinctBy(Function<? super T,? extends V> function)
distinctBy in interface ListIterable<T>distinctBy in interface MutableList<T>public MultiReaderList<T> sortThis()
sortThis in interface MultiReaderList<T>sortThis in interface MutableList<T>public MultiReaderList<T> sortThis(Comparator<? super T> comparator)
sortThis in interface MultiReaderList<T>sortThis in interface MutableList<T>public <V extends Comparable<? super V>> MultiReaderList<T> sortThisBy(Function<? super T,? extends V> function)
sortThisBy in interface MultiReaderList<T>sortThisBy in interface MutableList<T>public MultiReaderList<T> sortThisByInt(IntFunction<? super T> function)
sortThisByInt in interface MultiReaderList<T>sortThisByInt in interface MutableList<T>public MultiReaderList<T> sortThisByBoolean(BooleanFunction<? super T> function)
sortThisByBoolean in interface MultiReaderList<T>sortThisByBoolean in interface MutableList<T>public MultiReaderList<T> sortThisByChar(CharFunction<? super T> function)
sortThisByChar in interface MultiReaderList<T>sortThisByChar in interface MutableList<T>public MultiReaderList<T> sortThisByByte(ByteFunction<? super T> function)
sortThisByByte in interface MultiReaderList<T>sortThisByByte in interface MutableList<T>public MultiReaderList<T> sortThisByShort(ShortFunction<? super T> function)
sortThisByShort in interface MultiReaderList<T>sortThisByShort in interface MutableList<T>public MultiReaderList<T> sortThisByFloat(FloatFunction<? super T> function)
sortThisByFloat in interface MultiReaderList<T>sortThisByFloat in interface MutableList<T>public MultiReaderList<T> sortThisByLong(LongFunction<? super T> function)
sortThisByLong in interface MultiReaderList<T>sortThisByLong in interface MutableList<T>public MultiReaderList<T> sortThisByDouble(DoubleFunction<? super T> function)
sortThisByDouble in interface MultiReaderList<T>sortThisByDouble in interface MutableList<T>public MutableList<T> subList(int fromIndex, int toIndex)
subList in interface List<T>subList in interface ListIterable<T>subList in interface MutableList<T>public boolean equals(Object o)
public int hashCode()
public T get(int index)
public Optional<T> getFirstOptional()
getFirstOptional in interface OrderedIterable<T>public Optional<T> getLastOptional()
getLastOptional in interface OrderedIterable<T>public int indexOf(Object o)
public int lastIndexOf(Object o)
lastIndexOf in interface List<T>lastIndexOf in interface ListIterable<T>public ListIterator<T> listIterator()
multiReaderList.withReadLockAndDelegate(new Procedure<MutableList<Person>>()
{
public void value(MutableList<Person> people)
{
Iterator it = people.listIterator();
....
}
});
listIterator in interface List<T>listIterator in interface ListIterable<T>public void replaceAll(UnaryOperator<T> operator)
replaceAll in interface List<T>public void sort(Comparator<? super T> comparator)
public ListIterator<T> listIterator(int index)
multiReaderList.withReadLockAndDelegate(new Procedure<MutableList<Person>>()
{
public void value(MutableList<Person> people)
{
Iterator it = people.listIterator(0);
....
}
});
listIterator in interface List<T>listIterator in interface ListIterable<T>public boolean addAll(int index,
Collection<? extends T> collection)
public <S> boolean corresponds(OrderedIterable<S> other, Predicate2<? super T,? super S> predicate)
corresponds in interface OrderedIterable<T>public void forEach(int startIndex,
int endIndex,
Procedure<? super T> procedure)
forEach in interface OrderedIterable<T>public <T2> void forEachInBoth(ListIterable<T2> other, Procedure2<? super T,? super T2> procedure)
forEachInBoth in interface ListIterable<T>public int binarySearch(T key, Comparator<? super T> comparator)
binarySearch in interface ListIterable<T>public int binarySearch(T key)
binarySearch in interface ListIterable<T>public void reverseForEach(Procedure<? super T> procedure)
reverseForEach in interface ReversibleIterable<T>public void reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)
reverseForEachWithIndex in interface ReversibleIterable<T>public void forEachWithIndex(int fromIndex,
int toIndex,
ObjectIntProcedure<? super T> objectIntProcedure)
forEachWithIndex in interface OrderedIterable<T>public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic int detectIndex(Predicate<? super T> predicate)
detectIndex in interface OrderedIterable<T>public int detectLastIndex(Predicate<? super T> predicate)
detectLastIndex in interface ReversibleIterable<T>public <V> MutableListMultimap<V,T> groupBy(Function<? super T,? extends V> function)
groupBy in interface MutableCollection<T>groupBy in interface ListIterable<T>groupBy in interface MutableList<T>groupBy in interface OrderedIterable<T>groupBy in interface ReversibleIterable<T>groupBy in interface RichIterable<T>public <V> MutableListMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
groupByEach in interface MutableCollection<T>groupByEach in interface ListIterable<T>groupByEach in interface MutableList<T>groupByEach in interface OrderedIterable<T>groupByEach in interface ReversibleIterable<T>groupByEach in interface RichIterable<T>public <V> MutableMap<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
groupByUniqueKey in interface MutableCollection<T>groupByUniqueKey in interface RichIterable<T>public <S> MutableList<Pair<T,S>> zip(Iterable<S> that)
zip in interface MutableCollection<T>zip in interface ListIterable<T>zip in interface MutableList<T>zip in interface OrderedIterable<T>zip in interface ReversibleIterable<T>zip in interface RichIterable<T>public MutableList<Pair<T,Integer>> zipWithIndex()
zipWithIndex in interface MutableCollection<T>zipWithIndex in interface ListIterable<T>zipWithIndex in interface MutableList<T>zipWithIndex in interface OrderedIterable<T>zipWithIndex in interface ReversibleIterable<T>zipWithIndex in interface RichIterable<T>public MutableList<T> toReversed()
toReversed in interface ListIterable<T>toReversed in interface MutableList<T>toReversed in interface ReversibleIterable<T>public MultiReaderList<T> reverseThis()
reverseThis in interface MultiReaderList<T>reverseThis in interface MutableList<T>public MultiReaderList<T> shuffleThis()
shuffleThis in interface MultiReaderList<T>shuffleThis in interface MutableList<T>public MultiReaderList<T> shuffleThis(Random rnd)
shuffleThis in interface MultiReaderList<T>shuffleThis in interface MutableList<T>public MutableStack<T> toStack()
toStack in interface OrderedIterable<T>public RichIterable<RichIterable<T>> chunk(int size)
chunk in interface RichIterable<T>public MutableList<T> take(int count)
take in interface ListIterable<T>take in interface MutableList<T>take in interface ReversibleIterable<T>public MutableList<T> takeWhile(Predicate<? super T> predicate)
takeWhile in interface ListIterable<T>takeWhile in interface MutableList<T>takeWhile in interface OrderedIterable<T>takeWhile in interface ReversibleIterable<T>public MutableList<T> drop(int count)
drop in interface ListIterable<T>drop in interface MutableList<T>drop in interface ReversibleIterable<T>public MutableList<T> dropWhile(Predicate<? super T> predicate)
dropWhile in interface ListIterable<T>dropWhile in interface MutableList<T>dropWhile in interface OrderedIterable<T>dropWhile in interface ReversibleIterable<T>public PartitionMutableList<T> partitionWhile(Predicate<? super T> predicate)
partitionWhile in interface ListIterable<T>partitionWhile in interface MutableList<T>partitionWhile in interface OrderedIterable<T>partitionWhile in interface ReversibleIterable<T>public LazyIterable<T> asReversed()
asReversed in interface ReversibleIterable<T>public ParallelListIterable<T> asParallel(ExecutorService executorService, int batchSize)
asParallel in interface ListIterable<T>Copyright © 2004–2022. All rights reserved.