| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| AbstractMemoryEfficientMutableList | back to summary |
|---|---|
| public AbstractMemoryEfficientMutableList() | |
| add | back to summary |
|---|---|
| public boolean add(T o) Overrides org. Implements java. Doc from java. Appends the specified element to the end of this list (optional operation). Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
| |
| add | back to summary |
|---|---|
| public void add(int index, T element) Implements java. Doc from java. Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends T> collection) Overrides org. Implements java. Doc from java. Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(int index, Collection<? extends T> collection) Implements java. Doc from java. Inserts all of the elements in the specified collection into this list at the specified position (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in this list in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| addAllIterable | back to summary |
|---|---|
| public boolean addAllIterable(Iterable<? extends T> iterable) Overrides org. Implements org.
| |
| clear | back to summary |
|---|---|
| public void clear() Overrides org. Implements java. Doc from java. Removes all of the elements from this list (optional operation). The list will be empty after this call returns.
| |
| clone | back to summary |
|---|---|
| public FixedSizeList Overrides org. Implements org. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| insertionSort | back to summary |
|---|---|
| private void insertionSort(Comparator<? super T> comparator) | |
| isPreviousGreaterThanCurrent | back to summary |
|---|---|
| private boolean isPreviousGreaterThanCurrent(Comparator<? super T> comparator, int index) | |
| listIterator | back to summary |
|---|---|
| public ListIterator Overrides org. Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper
sequence), starting at the specified position in the list.
The specified index indicates the first element that would be
returned by an initial call to
| |
| listIterator | back to summary |
|---|---|
| public ListIterator Overrides org. Implements java. Doc from java. Returns a list iterator over the elements in this list (in proper sequence).
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Overrides org. Implements java. Doc from java. Removes the first occurrence of the specified element from this list,
if it is present (optional operation). If this list does not contain
the element, it is unchanged. More formally, removes the element with
the lowest index
| |
| remove | back to summary |
|---|---|
| public T remove(int index) Implements java. Doc from java. Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> collection) Overrides org. Implements java. Doc from java. Removes from this list all of its elements that are contained in the specified collection (optional operation).
| |
| removeAllIterable | back to summary |
|---|---|
| public boolean removeAllIterable(Iterable<?> iterable) Overrides org. Implements org.
| |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate<? super T> predicate) Overrides org. Implements org. Doc from org. Removes all elements in the collection that evaluate to true for the specified predicate. e.g. return lastNames.removeIf(Predicates.isNull());
| |
| removeIfWith | back to summary |
|---|---|
| public <P> boolean removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter. return lastNames.removeIfWith(Predicates2.isNull(), null);
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> collection) Overrides org. Implements java. Doc from java. Retains only the elements in this list that are contained in the specified collection (optional operation). In other words, removes from this list all of its elements that are not contained in the specified collection.
| |
| retainAllIterable | back to summary |
|---|---|
| public boolean retainAllIterable(Iterable<?> iterable) Overrides org. Implements org.
| |
| sort | back to summary |
|---|---|
| public void sort(Comparator<? super T> comparator) Overrides default java. This method checks if comparator is null and use a ComparableComparator if it is.
| |
| subList | back to summary |
|---|---|
| public MutableList Overrides org. Implements org. Doc from java. Returns a view of the portion of this list between the specified
This method eliminates the need for explicit range operations (of the sort that commonly exist for arrays). Any operation that expects a list can be used as a range operation by passing a subList view instead of a whole list. For example, the following idiom removes a range of elements from a list:
Similar idioms may be constructed for indexOf and
lastIndexOf, and all of the algorithms in the
Collections class can be applied to a subList.The semantics of the list returned by this method become undefined if the backing list (i.e., this list) is structurally modified in any way other than via the returned list. (Structural modifications are those that change the size of this list, or otherwise perturb it in such a fashion that iterations in progress may yield incorrect results.)
| |
| tap | back to summary |
|---|---|
| public FixedSizeList Overrides org. Overrides default org. Implements org. Doc from org. Executes the Procedure for each element in the iterable and returns Example using a Java 8 lambda expression:
RichIterable<Person> tapped =
people.tap(person -> LOGGER.info(person.getName()));
| |
| toReversed | back to summary |
|---|---|
| public FixedSizeList Overrides default org. Implements org. Doc from org. Returns a new MutableList in reverse order.
| |
| withAll | back to summary |
|---|---|
| public MutableList Overrides default org. Implements org. Doc from org. This method allows fixed size collections the ability to add multiple elements to their existing elements. A new
instance of
MutableCollection<String> list;
list = list.withAll(FastList.newListWith("1", "2"));
return list;
| |
| without | back to summary |
|---|---|
| public MutableList Overrides default org. Implements org. Doc from org. This method allows fixed size collections the ability to remove elements from their existing elements. A new
instance of
MutableCollection<String> list;
list = list.without("1");
list = list.without("2");
return list;
| |
| withoutAll | back to summary |
|---|---|
| public MutableList Overrides default org. Implements org. Doc from org. This method allows fixed size collections the ability to remove multiple elements from their existing elements.
A new instance of
MutableCollection<String> list;
list = list.withoutAll(FastList.newListWith("1", "2"));
return list;
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | addAll(Collection<? extends T> collection)
Overrides org. Implements java. Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). |
| public boolean | addAllIterable(Iterable<? extends T> iterable)
Overrides org. Implements org.
|
| public boolean | remove(Object o)
Overrides org. Implements java. Removes the first occurrence of the specified element from this list, if it is present (optional operation). |
| public boolean | removeAll(Collection<?> collection)
Overrides org. Implements java. Removes from this list all of its elements that are contained in the specified collection (optional operation). |
| public boolean | |
| public boolean | removeIf(Predicate<? super T> predicate)
Overrides org. Implements org. Removes all elements in the collection that evaluate to true for the specified predicate. |
| public <P> boolean | removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter. |
| public boolean | retainAll(Collection<?> collection)
Overrides org. Implements java. Retains only the elements in this list that are contained in the specified collection (optional operation). |
| public boolean |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| SubList | back to summary |
|---|---|
| protected SubList(AbstractMutableList<T> list, int fromIndex, int toIndex) | |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends T> collection) Overrides org. Implements java. Doc from java. Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
| |
| addAllIterable | back to summary |
|---|---|
| public boolean addAllIterable(Iterable<? extends T> iterable) Overrides org. Implements org.
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object o) Overrides org. Implements java. Doc from java. Removes the first occurrence of the specified element from this list,
if it is present (optional operation). If this list does not contain
the element, it is unchanged. More formally, removes the element with
the lowest index
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> collection) Overrides org. Implements java. Doc from java. Removes from this list all of its elements that are contained in the specified collection (optional operation).
| |
| removeAllIterable | back to summary |
|---|---|
| public boolean removeAllIterable(Iterable<?> iterable) Overrides org. Implements org.
| |
| removeIf | back to summary |
|---|---|
| public boolean removeIf(Predicate<? super T> predicate) Overrides org. Implements org. Doc from org. Removes all elements in the collection that evaluate to true for the specified predicate. e.g. return lastNames.removeIf(Predicates.isNull());
| |
| removeIfWith | back to summary |
|---|---|
| public <P> boolean removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter. return lastNames.removeIfWith(Predicates2.isNull(), null);
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> collection) Overrides org. Implements java. Doc from java. Retains only the elements in this list that are contained in the specified collection (optional operation). In other words, removes from this list all of its elements that are not contained in the specified collection.
| |
| retainAllIterable | back to summary |
|---|---|
| public boolean retainAllIterable(Iterable<?> iterable) Overrides org. Implements org.
| |