public interface FixedSizeCollection<T> extends MutableCollection<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T t) |
boolean |
addAll(java.util.Collection<? extends T> collection) |
boolean |
addAllIterable(java.lang.Iterable<? extends T> iterable) |
void |
clear() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> collection) |
boolean |
removeAllIterable(java.lang.Iterable<?> iterable) |
void |
removeIf(Predicate<? super T> predicate)
Removes all elements in the collection that evaluate to true for the specified predicate.
|
<P> void |
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(java.util.Collection<?> collection) |
boolean |
retainAllIterable(java.lang.Iterable<?> iterable) |
MutableCollection<T> |
with(T element)
This method allows fixed size collections the ability to add elements to their existing elements.
|
MutableCollection<T> |
withAll(java.lang.Iterable<? extends T> elements)
This method allows fixed size collections the ability to add multiple elements to their existing elements.
|
MutableCollection<T> |
without(T element)
This method allows fixed size collections the ability to remove elements from their existing elements.
|
MutableCollection<T> |
withoutAll(java.lang.Iterable<? extends T> elements)
This method allows fixed size collections the ability to remove multiple elements from their existing elements.
|
aggregateBy, aggregateInPlaceBy, asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, flatCollect, groupBy, groupByEach, groupByUniqueKey, injectIntoWith, newEmpty, partition, partitionWith, reject, rejectWith, select, selectAndRejectWith, selectInstancesOf, selectWith, toImmutable, zip, zipWithIndexcontains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArrayallSatisfy, 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, detectWith, detectWithIfNone, flatCollect, getFirst, getLast, groupBy, groupByEach, injectInto, injectInto, injectInto, injectInto, injectInto, isEmpty, makeString, makeString, makeString, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toList, toMap, toSet, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexforEach, forEachWith, forEachWithIndexMutableCollection<T> with(T element)
MutableCollection is returned containing the elements of the original collection with the new element
added. Implementations will return a new FixedSizeCollection where possible. In order to
use this method properly with mutable and fixed size collections the following approach must be taken:
MutableCollectionlist; list = list.with("1"); list = list.with("2"); return list;
with in interface MutableCollection<T>add(Object)MutableCollection<T> without(T element)
MutableCollection is returned containing the elements of the original collection with the
element removed. Implementations will return a new FixedSizeCollection where possible.
In order to use this method properly with mutable and fixed size collections the following approach must be
taken:
MutableCollectionlist; list = list.without("1"); list = list.without("2"); return list;
without in interface MutableCollection<T>remove(Object)MutableCollection<T> withAll(java.lang.Iterable<? extends T> elements)
MutableCollection is returned containing the elements of the original collection with all of
the new elements added. Implementations will return a new FixedSizeCollection where
possible. In order to use this method properly with mutable and fixed size collections the following approach
must be taken:
MutableCollectionlist; list = list.withAll(FastList.newListWith("1", "2")); return list;
withAll in interface MutableCollection<T>addAll(Collection)MutableCollection<T> withoutAll(java.lang.Iterable<? extends T> elements)
MutableCollection is returned containing the elements of the original collection with
the given elements removed. Implementations will return a new FixedSizeCollection
where possible. In order to use this method properly with mutable and fixed size collections the following
approach must be taken:
MutableCollectionlist; list = list.withoutAll(FastList.newListWith("1", "2")); return list;
withoutAll in interface MutableCollection<T>removeAll(Collection)boolean add(T t)
add in interface java.util.Collection<T>java.lang.UnsupportedOperationExceptionboolean addAllIterable(java.lang.Iterable<? extends T> iterable)
addAllIterable in interface MutableCollection<T>java.lang.UnsupportedOperationExceptionCollection.addAll(Collection)boolean addAll(java.util.Collection<? extends T> collection)
addAll in interface java.util.Collection<T>java.lang.UnsupportedOperationExceptionboolean remove(java.lang.Object o)
remove in interface java.util.Collection<T>java.lang.UnsupportedOperationExceptionboolean removeAll(java.util.Collection<?> collection)
removeAll in interface java.util.Collection<T>java.lang.UnsupportedOperationExceptionboolean removeAllIterable(java.lang.Iterable<?> iterable)
removeAllIterable in interface MutableCollection<T>java.lang.UnsupportedOperationExceptionCollection.removeAll(Collection)void removeIf(Predicate<? super T> predicate)
MutableCollectione.g. return lastNames.removeIf(Predicates.isNull());
removeIf in interface MutableCollection<T>java.lang.UnsupportedOperationException<P> void removeIfWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableCollectione.g. return lastNames.removeIfWith(PredicatesLite.isNull(), null);
removeIfWith in interface MutableCollection<T>java.lang.UnsupportedOperationExceptionboolean retainAll(java.util.Collection<?> collection)
retainAll in interface java.util.Collection<T>java.lang.UnsupportedOperationExceptionboolean retainAllIterable(java.lang.Iterable<?> iterable)
retainAllIterable in interface MutableCollection<T>java.lang.UnsupportedOperationExceptionCollection.retainAll(Collection)void clear()
clear in interface java.util.Collection<T>java.lang.UnsupportedOperationException