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.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private MutableList | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | add(int index, T element)
Implements java. Inserts the specified element at the specified position in this list (optional operation). |
| public boolean | addAll(int index, Collection<? extends T> collection)
Implements java. Inserts all of the elements in the specified collection into this list at the specified position (optional operation). |
| public ParallelListIterable | asParallel(ExecutorService executorService, int batchSize)
Implements org. Returns a parallel iterable of this ListIterable. |
| pack-priv MultiReaderFastList. | |
| public LazyIterable | asReversed()
Overrides default org. Returns a reversed view of this ReversibleIterable. |
| public MutableList | asSynchronized()
Implements org. Returns a synchronized wrapper backed by this collection. |
| public MutableList | asUnmodifiable()
Implements org. Returns an unmodifiable view of the list. |
| pack-priv MultiReaderFastList. | |
| public int | binarySearch(T key, Comparator<? super T> comparator)
Overrides default org. Searches for the specified object using the binary search algorithm. |
| public int | binarySearch(T key)
Overrides default org. Searches for the specified object using the binary search algorithm. |
| public RichIterable | chunk(int size)
Implements org. Partitions elements in fixed size chunks. |
| public MultiReaderList | clone()
Overrides java. Implements org. Creates and returns a copy of this object. |
| public <V> MutableList | collect(Function<? super T, ? extends V> function)
Overrides default org. Implements org. Returns a new MutableCollection with the results of applying the specified function to each element of the source collection. |
| public MutableBooleanList | collectBoolean(BooleanFunction<? super T> booleanFunction)
Overrides default org. Returns a new primitive |
| public MutableByteList | collectByte(ByteFunction<? super T> byteFunction)
Overrides default org. Returns a new primitive |
| public MutableCharList | collectChar(CharFunction<? super T> charFunction)
Overrides default org. Returns a new primitive |
| public MutableDoubleList | collectDouble(DoubleFunction<? super T> doubleFunction)
Overrides default org. Returns a new primitive |
| public MutableFloatList | collectFloat(FloatFunction<? super T> floatFunction)
Overrides default org. Returns a new primitive |
| public <V> MutableList | collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)
Overrides default org. Implements org. Returns a new MutableCollection with the results of applying the specified function to each element of the source collection, but only for elements that evaluate to true for the specified predicate. |
| public MutableIntList | collectInt(IntFunction<? super T> intFunction)
Overrides default org. Returns a new primitive |
| public MutableLongList | collectLong(LongFunction<? super T> longFunction)
Overrides default org. Returns a new primitive |
| public MutableShortList | collectShort(ShortFunction<? super T> shortFunction)
Overrides default org. Returns a new primitive |
| public <P, V> MutableList | collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)
Overrides default org. Implements org. Same as |
| public <S> boolean | corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)
Implements org. Returns true if both OrderedIterables have the same length
and |
| public int | detectIndex(Predicate<? super T> predicate)
Implements org. Returns the index of the first element of the |
| public int | detectLastIndex(Predicate<? super T> predicate)
Implements org. Returns the index of the last element of the |
| public MutableList | distinct()
Implements org. Returns a new |
| public MutableList | distinct(HashingStrategy<? super T> hashingStrategy)
Implements org. Returns a new |
| public <V> MutableList | distinctBy(Function<? super T, ? extends V> function)
Implements org. Returns a new |
| public MutableList | drop(int count)
Implements org. Returns an iterable after skipping the first |
| public MutableList | dropWhile(Predicate<? super T> predicate)
Implements org. Returns the final elements that do not satisfy the Predicate. |
| public boolean | equals(Object o)
Overrides java. Implements java. Compares the specified object with this list for equality. |
| public <V> MutableList | flatCollect(Function<? super T, ? extends Iterable<V>> function)
Overrides default org. Implements org.
|
| public void | forEach(int startIndex, int endIndex, Procedure<? super T> procedure)
Implements org. Iterates over the section of the iterable covered by the specified inclusive indexes. |
| public <T2> void | forEachInBoth(ListIterable<T2> other, Procedure2<? super T, ? super T2> procedure)
Overrides default org. Iterates over this ListIterable and the other ListIterable together passing the elements of each list as parameters to the specified procedure. |
| public void | forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)
Implements org. Iterates over the section of the iterable covered by the specified inclusive indexes. |
| public T | get(int index)
Implements java. Returns the element at the specified position in this list. |
| protected MutableList | |
| public Optional | getFirstOptional()
Overrides default org. Returns the first element of an iterable as an Optional. |
| public Optional | getLastOptional()
Overrides default org. Returns the last element of an iterable as an Optional. |
| public <V> MutableListMultimap | groupBy(Function<? super T, ? extends V> function)
Implements org. For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable. |
| public <V> MutableListMultimap | groupByEach(Function<? super T, ? extends Iterable<V>> function)
Implements org. Similar to |
| public <V> MutableMap | groupByUniqueKey(Function<? super T, ? extends V> function)
Overrides default org. Implements org. For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key. |
| public int | hashCode()
Overrides java. Implements java. Returns the hash code value for this list. |
| public int | indexOf(Object o)
Overrides default org. Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. |
| public int | lastIndexOf(Object o)
Implements java. Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. |
| public ListIterator | listIterator()
Implements java. This method is not supported directly on a MultiReaderFastList. |
| public ListIterator | listIterator(int index)
Implements java. This method is not supported directly on a MultiReaderFastList. |
| public MultiReaderList | newEmpty()
Implements org. Creates a new empty mutable version of the same collection type. |
| public static <T> MultiReaderFastList | |
| public static <T> MultiReaderFastList | |
| public static <T> MultiReaderFastList | |
| public static <T> MultiReaderFastList | |
| public PartitionMutableList | partition(Predicate<? super T> predicate)
Implements org. Filters a collection into a PartitionedIterable based on the evaluation of the predicate. |
| public PartitionMutableList | partitionWhile(Predicate<? super T> predicate)
Implements org. Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements. |
| public <P> PartitionMutableList | partitionWith(Predicate2<? super T, ? super P> predicate, P parameter)
Implements org. Filters a collection into a PartitionIterable based on the evaluation of the predicate. |
| public void | readExternal(ObjectInput in)
Implements java. The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
| public T | remove(int index)
Implements java. Removes the element at the specified position in this list (optional operation). |
| public void | replaceAll(UnaryOperator<T> operator)
Overrides default java. Replaces each element of this list with the result of applying the operator to that element (optional operation). |
| public void | reverseForEach(Procedure<? super T> procedure)
Overrides default org. Evaluates the procedure for each element of the list iterating in reverse order. |
| public void | reverseForEachWithIndex(ObjectIntProcedure<? super T> procedure)
Overrides default org. Evaluates the procedure for each element and it's index in reverse order. |
| public MultiReaderList | reverseThis()
Implements org. Mutates this list by reversing its order and returns the current list as a result. |
| public <S> MutableList | selectInstancesOf(Class<S> clazz)
Implements org. Returns all elements of the source collection that are instances of the Class |
| public T | set(int index, T element)
Implements java. Replaces the element at the specified position in this list with the specified element (optional operation). |
| public MultiReaderList | shuffleThis()
Implements org. Mutates this list by shuffling its elements. |
| public MultiReaderList | shuffleThis(Random rnd)
Implements org. Mutates this list by shuffling its elements using the specified random. |
| public void | sort(Comparator<? super T> comparator)
Overrides default java. Sorts this list according to the order induced by the specified
|
| public MultiReaderList | sortThis()
Overrides default org. Sorts the internal data structure of this list and returns the list itself as a convenience. |
| public MultiReaderList | sortThis(Comparator<? super T> comparator)
Overrides default org. Sorts the internal data structure of this list and returns the list itself as a convenience. |
| public <V extends Comparable | sortThisBy(Function<? super T, ? extends V> function)
Implements org. Sorts the internal data structure of this list based on the natural order of the attribute returned by |
| public MultiReaderList | sortThisByBoolean(BooleanFunction<? super T> function)
Implements org.
|
| public MultiReaderList | sortThisByByte(ByteFunction<? super T> function)
Implements org.
|
| public MultiReaderList | sortThisByChar(CharFunction<? super T> function)
Implements org.
|
| public MultiReaderList | sortThisByDouble(DoubleFunction<? super T> function)
Implements org.
|
| public MultiReaderList | sortThisByFloat(FloatFunction<? super T> function)
Implements org.
|
| public MultiReaderList | sortThisByInt(IntFunction<? super T> function)
Implements org.
|
| public MultiReaderList | sortThisByLong(LongFunction<? super T> function)
Implements org.
|
| public MultiReaderList | sortThisByShort(ShortFunction<? super T> function)
Implements org.
|
| public MultiReaderList | subList(int fromIndex, int toIndex)
Implements org. Returns a view of the portion of this list between the specified
|
| public MutableList | take(int count)
Implements org. Returns the first |
| public MutableList | takeWhile(Predicate<? super T> predicate)
Implements org. Returns the initial elements that satisfy the Predicate. |
| public MultiReaderList | tap(Procedure<? super T> procedure)
Overrides default org. Implements org. Executes the Procedure for each element in the iterable and returns |
| public ImmutableList | toImmutable()
Overrides default org. Implements org. Returns an immutable copy of this list. |
| public MutableList | toReversed()
Overrides default org. Returns a new MutableList in reverse order. |
| public MutableStack | toStack()
Overrides default org. Converts the OrderedIterable to a mutable MutableStack implementation. |
| public void | withReadLockAndDelegate(Procedure<? super MutableList<T>> procedure)
Implements org.
|
| public void | withWriteLockAndDelegate(Procedure<? super MutableList<T>> procedure)
Implements org.
|
| public void | writeExternal(ObjectOutput out)
Implements java. The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
| public <S> MutableList | zip(Iterable<S> that)
Implements org. Returns a |
| public MutableList | zipWithIndex()
Implements org. Zips this |