public interface FixedSizeList<T> extends MutableList<T>, FixedSizeCollection<T>
| Modifier and Type | Method and Description |
|---|---|
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> |
with(T element)
This method allows mutable and fixed size collections the ability to add elements to their existing elements.
|
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.
|
asSynchronized, asUnmodifiable, clone, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, collectWithIndex, distinct, distinct, distinctBy, drop, dropWhile, flatCollect, flatCollectWith, 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, subList, take, takeWhile, toImmutable, zip, zipWithIndexadd, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, toArray, toArrayasParallel, binarySearch, binarySearch, equals, forEachInBoth, get, getFirst, getLast, hashCode, lastIndexOf, listIterator, listIteratorasReversed, detectLastIndex, reverseForEach, reverseForEachWithIndexcollectWithIndex, corresponds, detectIndex, forEach, forEachWithIndex, forEachWithIndex, getFirstOptional, getLastOptional, indexOf, toStackaggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsBy, 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, into, isEmpty, 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, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toStringforEachWithadd, addAll, addAllIterable, clear, remove, removeAll, removeAllIterable, removeIf, removeIfWith, retainAll, retainAllIterableaggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, groupByUniqueKey, injectIntoWith, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongparallelStream, removeIf, streamMutableList<T> with(T element)
MutableCollection
MutableCollection<String> list = list.with("1");
list = list.with("2");
return list;
In the case of FixedSizeCollection a new instance of MutableCollection will be returned by with, 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 add on itself.with in interface FixedSizeCollection<T>with in interface MutableCollection<T>with in interface MutableList<T>Collection.add(Object)MutableList<T> without(T element)
MutableCollection
MutableCollection<String> list = list.without("1");
list = list.without("2");
return list;
In the case of 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>Collection.remove(Object)MutableList<T> withAll(Iterable<? extends T> elements)
MutableCollection
MutableCollection<String> list = list.withAll(FastList.newListWith("1", "2"));
In the case of 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>Collection.addAll(Collection)MutableList<T> withoutAll(Iterable<? extends T> elements)
MutableCollection
MutableCollection<String> list = list.withoutAll(FastList.newListWith("1", "2"));
In the case of 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>Collection.removeAll(Collection)FixedSizeList<T> toReversed()
MutableListtoReversed in interface ListIterable<T>toReversed in interface MutableList<T>toReversed in interface ReversibleIterable<T>FixedSizeList<T> tap(Procedure<? super T> procedure)
RichIterablethis.
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<Person>()
{
public void value(Person person)
{
LOGGER.info(person.getName());
}
});
tap in interface FixedSizeCollection<T>tap in interface ListIterable<T>tap in interface MutableCollection<T>tap in interface MutableList<T>tap in interface OrderedIterable<T>tap in interface ReversibleIterable<T>tap in interface RichIterable<T>RichIterable.each(Procedure),
RichIterable.forEach(Procedure)Copyright © 2004–2020. All rights reserved.