public abstract class AbstractMemoryEfficientMutableList<T> extends AbstractMutableList<T> implements FixedSizeList<T>, RandomAccess
Constructor and Description |
---|
AbstractMemoryEfficientMutableList() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T element) |
boolean |
add(T o) |
boolean |
addAll(Collection<? extends T> collection) |
boolean |
addAll(int index,
Collection<? extends T> collection) |
boolean |
addAllIterable(Iterable<? extends T> iterable) |
void |
clear() |
FixedSizeList<T> |
clone() |
ListIterator<T> |
listIterator() |
ListIterator<T> |
listIterator(int index) |
T |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> collection) |
boolean |
removeAllIterable(Iterable<?> iterable) |
boolean |
removeIf(Predicate<? super T> predicate)
Removes all elements in the collection that evaluate to true for the specified predicate.
|
<P> boolean |
removeIfWith(Predicate2<? super T,? super P> predicate,
P parameter)
Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter.
|
boolean |
retainAll(Collection<?> collection) |
boolean |
retainAllIterable(Iterable<?> iterable) |
MutableList<T> |
subList(int fromIndex,
int toIndex) |
FixedSizeList<T> |
tap(Procedure<? super T> procedure)
Executes the Procedure for each element in the iterable and returns
this . |
FixedSizeList<T> |
toReversed()
Returns a new MutableList in reverse order
|
MutableList<T> |
withAll(Iterable<? extends T> elements)
This method allows mutable and fixed size collections the ability to add multiple elements to their existing
elements.
|
MutableList<T> |
without(T element)
This method allows mutable and fixed size collections the ability to remove elements from their existing elements.
|
MutableList<T> |
withoutAll(Iterable<? extends T> elements)
This method allows mutable and fixed size collections the ability to remove multiple elements from their existing
elements.
|
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asParallel, asReversed, asSynchronized, asUnmodifiable, binarySearch, chunk, collect, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectIf, collectInt, collectLong, collectShort, collectWith, collectWith, contains, containsAll, corresponds, count, countWith, detect, detectIndex, detectLastIndex, detectOptional, detectWith, detectWithOptional, distinct, distinct, drop, dropWhile, each, equals, flatCollect, flatCollect, forEach, forEachWith, forEachWithIndex, forEachWithIndex, getFirst, getLast, groupBy, groupByEach, groupByUniqueKey, hashCode, indexOf, injectInto, injectInto, injectInto, injectInto, injectIntoWith, iterator, lastIndexOf, max, max, maxBy, min, min, minBy, newEmpty, noneSatisfy, noneSatisfyWith, partition, partitionWhile, partitionWith, reject, reject, rejectWith, rejectWith, reverseForEach, reverseThis, select, select, selectAndRejectWith, selectInstancesOf, selectWith, selectWith, shuffleThis, shuffleThis, sortThis, sortThis, sortThisBy, sortThisByBoolean, sortThisByByte, sortThisByChar, sortThisByDouble, sortThisByFloat, sortThisByInt, sortThisByLong, sortThisByShort, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, take, takeWhile, toImmutable, toList, toSet, toSortedList, toSortedList, toStack, with, zip, zip, zipWithIndex, zipWithIndex
aggregateBy, aggregateInPlaceBy, reduce, sumByDouble, sumByFloat, sumByInt, sumByLong
asLazy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAllArguments, containsAllIterable, detectIfNone, detectWithIfNone, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, into, isEmpty, toArray, toArray, toBag, toMap, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString
asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, distinct, distinct, drop, dropWhile, flatCollect, groupBy, groupByEach, newEmpty, partition, partitionWhile, partitionWith, reject, rejectWith, reverseThis, select, selectInstancesOf, selectWith, shuffleThis, shuffleThis, sortThis, sortThis, sortThisBy, sortThisByBoolean, sortThisByByte, sortThisByChar, sortThisByDouble, sortThisByFloat, sortThisByInt, sortThisByLong, sortThisByShort, take, takeWhile, toImmutable, with, zip, zipWithIndex
contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, replaceAll, set, size, sort, spliterator, toArray, toArray
asParallel, binarySearch, binarySearch, equals, get, getFirst, getLast, hashCode, lastIndexOf, toStack
asReversed, detectLastIndex, reverseForEach
corresponds, detectIndex, forEach, forEachWithIndex, forEachWithIndex, indexOf
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, 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, getOnly, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, makeString, makeString, makeString, max, maxBy, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString
forEach, forEachWith
with
aggregateBy, aggregateInPlaceBy, groupByUniqueKey, injectIntoWith, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong
parallelStream, removeIf, stream
public FixedSizeList<T> clone()
clone
in interface MutableList<T>
clone
in class AbstractMutableList<T>
public FixedSizeList<T> tap(Procedure<? super T> procedure)
RichIterable
this
.
Example using a Java 8 lambda expression:
RichIterable<Person> tapped = people.tap(person -> LOGGER.info(person.getName()));
Example using an anonymous inner class:
RichIterable<Person> tapped = people.tap(new Procedure() { public void value(Person person) { LOGGER.info(person.getName()); } });
tap
in interface FixedSizeCollection<T>
tap
in interface MutableCollection<T>
tap
in interface FixedSizeList<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>
tap
in class AbstractMutableList<T>
RichIterable.each(Procedure)
,
InternalIterable.forEach(Procedure)
public boolean add(T o)
add
in interface Collection<T>
add
in interface List<T>
add
in interface FixedSizeCollection<T>
add
in class AbstractMutableCollection<T>
public boolean addAll(Collection<? extends T> collection)
addAll
in interface Collection<T>
addAll
in interface List<T>
addAll
in interface FixedSizeCollection<T>
addAll
in class AbstractMutableCollection<T>
public boolean addAll(int index, Collection<? extends T> collection)
public boolean addAllIterable(Iterable<? extends T> iterable)
addAllIterable
in interface FixedSizeCollection<T>
addAllIterable
in interface MutableCollection<T>
addAllIterable
in class AbstractMutableCollection<T>
Collection.addAll(Collection)
public boolean remove(Object o)
remove
in interface Collection<T>
remove
in interface List<T>
remove
in interface FixedSizeCollection<T>
remove
in class AbstractMutableCollection<T>
public boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<T>
removeAll
in interface List<T>
removeAll
in interface FixedSizeCollection<T>
removeAll
in class AbstractMutableList<T>
public boolean removeAllIterable(Iterable<?> iterable)
removeAllIterable
in interface FixedSizeCollection<T>
removeAllIterable
in interface MutableCollection<T>
removeAllIterable
in class AbstractMutableCollection<T>
Collection.removeAll(Collection)
public boolean removeIf(Predicate<? super T> predicate)
MutableCollection
e.g. return lastNames.removeIf(Predicates.isNull());
removeIf
in interface FixedSizeCollection<T>
removeIf
in interface MutableCollection<T>
removeIf
in class AbstractMutableList<T>
public <P> boolean removeIfWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableCollection
e.g. return lastNames.removeIfWith(PredicatesLite.isNull(), null);
removeIfWith
in interface FixedSizeCollection<T>
removeIfWith
in interface MutableCollection<T>
removeIfWith
in class AbstractMutableList<T>
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<T>
retainAll
in interface List<T>
retainAll
in interface FixedSizeCollection<T>
retainAll
in class AbstractMutableList<T>
public boolean retainAllIterable(Iterable<?> iterable)
retainAllIterable
in interface FixedSizeCollection<T>
retainAllIterable
in interface MutableCollection<T>
retainAllIterable
in class AbstractMutableCollection<T>
Collection.retainAll(Collection)
public void clear()
clear
in interface Collection<T>
clear
in interface List<T>
clear
in interface FixedSizeCollection<T>
public FixedSizeList<T> toReversed()
MutableList
toReversed
in interface FixedSizeList<T>
toReversed
in interface ListIterable<T>
toReversed
in interface MutableList<T>
toReversed
in interface ReversibleIterable<T>
toReversed
in class AbstractMutableList<T>
public MutableList<T> subList(int fromIndex, int toIndex)
subList
in interface List<T>
subList
in interface MutableList<T>
subList
in class AbstractMutableList<T>
public MutableList<T> without(T element)
MutableCollection
MutableCollectionIn the case oflist; list = list.without("1"); list = list.without("2"); return list;
FixedSizeCollection
a new instance of MutableCollection will be returned by without, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling remove on itself.without
in interface FixedSizeCollection<T>
without
in interface MutableCollection<T>
without
in interface MutableList<T>
without
in class AbstractMutableList<T>
Collection.remove(Object)
public MutableList<T> withAll(Iterable<? extends T> elements)
MutableCollection
MutableCollectionIn the case oflist; list = list.withAll(FastList.newListWith("1", "2")); return list;
FixedSizeCollection
a new instance of MutableCollection will be returned by withAll, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling addAll on itself.withAll
in interface FixedSizeCollection<T>
withAll
in interface MutableCollection<T>
withAll
in interface MutableList<T>
withAll
in class AbstractMutableList<T>
Collection.addAll(Collection)
public MutableList<T> withoutAll(Iterable<? extends T> elements)
MutableCollection
MutableCollectionIn the case oflist; list = list.withoutAll(FastList.newListWith("1", "2")); return list;
FixedSizeCollection
a new instance of MutableCollection will be returned by withoutAll,
and any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling removeAll on itself.withoutAll
in interface FixedSizeCollection<T>
withoutAll
in interface MutableCollection<T>
withoutAll
in interface MutableList<T>
withoutAll
in class AbstractMutableList<T>
Collection.removeAll(Collection)
public ListIterator<T> listIterator(int index)
listIterator
in interface List<T>
listIterator
in interface ListIterable<T>
listIterator
in class AbstractMutableList<T>
List.listIterator(int)
public ListIterator<T> listIterator()
listIterator
in interface List<T>
listIterator
in interface ListIterable<T>
listIterator
in class AbstractMutableList<T>
List.listIterator()
Copyright © 2004–2016. All rights reserved.