MutableList. It is imperative that the user manually synchronize on the collection when iterating over it using the
standard JDK iterator or JDK 5 for loop, as per Collections#synchronizedCollection(Collection).
MutableList#asSynchronized()
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| 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. |
| 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. |
| 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 MutableList | clone()
Overrides java. Implements org. Creates and returns a copy of this object. |
| public <V> MutableList | collect(Function<? super T, ? extends V> function)
Overrides org. 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 org. Overrides default org. Implements org. Returns a new primitive |
| public MutableByteList | collectByte(ByteFunction<? super T> byteFunction)
Overrides org. Overrides default org. Implements org. Returns a new primitive |
| public MutableCharList | collectChar(CharFunction<? super T> charFunction)
Overrides org. Overrides default org. Implements org. Returns a new primitive |
| public MutableDoubleList | collectDouble(DoubleFunction<? super T> doubleFunction)
Overrides org. Overrides default org. Implements org. Returns a new primitive |
| public MutableFloatList | collectFloat(FloatFunction<? super T> floatFunction)
Overrides org. Overrides default org. Implements org. Returns a new primitive |
| public <V> MutableList | collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)
Overrides org. 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 org. Overrides default org. Implements org. Returns a new primitive |
| public MutableLongList | collectLong(LongFunction<? super T> longFunction)
Overrides org. Overrides default org. Implements org. Returns a new primitive |
| public MutableShortList | collectShort(ShortFunction<? super T> shortFunction)
Overrides org. Overrides default org. Implements org. Returns a new primitive |
| public <P, V> MutableList | collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)
Overrides org. Overrides default org. Implements org. Same as |
| public <V> MutableList | collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function)
Overrides default org. Returns a new OrderedIterable using results obtained by applying the specified function to each element and its corresponding index. |
| public <V, R extends Collection | collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function, R target)
Overrides default org. Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index. |
| 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 <V> MutableList | flatCollect(Function<? super T, ? extends Iterable<V>> function)
Overrides org. Overrides default org. Implements org.
|
| public void | forEach(int fromIndex, int toIndex, 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)
Overrides org. 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)
Overrides org. Implements org. Similar to |
| 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. Returns a list iterator over the elements in this list (in proper sequence). |
| public ListIterator | listIterator(int index)
Implements java. Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list. |
| public MutableList | newEmpty()
Implements org. Creates a new empty mutable version of the same collection type. |
| public static <E, L extends List | of(L list)
Hides java. This method will take a MutableList and wrap it directly in a SynchronizedMutableList. |
| public static <E, L extends List | of(L list, Object lock)
Hides java. This method will take a MutableList and wrap it directly in a SynchronizedMutableList. |
| public PartitionMutableList | partition(Predicate<? super T> predicate)
Overrides org. 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)
Overrides org. Implements org. Filters a collection into a PartitionIterable based on the evaluation of the predicate. |
| public MutableList | reject(Predicate<? super T> predicate)
Overrides org. Overrides default org. Implements org. Returns a MutableCollection with all elements that evaluate to false for the specified predicate. |
| public <P> MutableList | rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Overrides default org. Implements org. Returns a MutableCollection with all elements that evaluate to false for the specified predicate2 and parameter. |
| public MutableList | rejectWithIndex(ObjectIntPredicate<? super T> predicate)
Overrides default org. Returns a new MutableList with all elements of the collection that return false when evaluating the specified predicate which is supplied each element and its relative index. |
| public <R extends Collection | rejectWithIndex(ObjectIntPredicate<? super T> predicate, R target)
Overrides default org. Adds all elements to the target Collection that return false when evaluating the specified predicate which is supplied each element and its relative index. |
| 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 MutableList | reverseThis()
Overrides default org. Mutates this list by reversing its order and returns the current list as a result. |
| public MutableList | select(Predicate<? super T> predicate)
Overrides org. Overrides default org. Implements org. Returns a MutableCollection with all elements that evaluate to true for the specified predicate. |
| public <S> MutableList | selectInstancesOf(Class<S> clazz)
Implements org. Returns all elements of the source collection that are instances of the Class |
| public <P> MutableList | selectWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Overrides default org. Implements org. Returns a MutableCollection with all elements that evaluate to true for the specified predicate2 and parameter. |
| public MutableList | selectWithIndex(ObjectIntPredicate<? super T> predicate)
Overrides default org. Returns a new MutableList with all elements of the collection that return true when evaluating the specified predicate which is supplied each element and its relative index. |
| public <R extends Collection | selectWithIndex(ObjectIntPredicate<? super T> predicate, R target)
Overrides default org. Adds all elements to the target Collection that return true when evaluating the specified predicate which is supplied each element and its relative index. |
| 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 MutableList | shuffleThis()
Overrides default org. Mutates this list by shuffling its elements. |
| public MutableList | shuffleThis(Random rnd)
Overrides default 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 MutableList | 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 MutableList | sortThis()
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)
Overrides default org. Sorts the internal data structure of this list based on the natural order of the attribute returned by |
| public MutableList | sortThisByBoolean(BooleanFunction<? super T> function)
Implements org.
|
| public MutableList | sortThisByByte(ByteFunction<? super T> function)
Implements org.
|
| public MutableList | sortThisByChar(CharFunction<? super T> function)
Implements org.
|
| public MutableList | sortThisByDouble(DoubleFunction<? super T> function)
Implements org.
|
| public MutableList | sortThisByFloat(FloatFunction<? super T> function)
Implements org.
|
| public MutableList | sortThisByInt(IntFunction<? super T> function)
Implements org.
|
| public MutableList | sortThisByLong(LongFunction<? super T> function)
Implements org.
|
| public MutableList | sortThisByShort(ShortFunction<? super T> function)
Implements org.
|
| public MutableList | 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 MutableList | tap(Procedure<? super T> procedure)
Overrides org. 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. |
| protected Object | |
| public <S> MutableList | zip(Iterable<S> that)
Overrides org. Implements org. Returns a |
| public MutableList | zipWithIndex()
Overrides org. Implements org. Zips this |