public interface MultiReaderSet<T> extends MutableSet<T>
withReadLockAndDelegate() and withWriteLockAndDelegate().| Modifier and Type | Method and Description |
|---|---|
MultiReaderSet<T> |
clone() |
MultiReaderSet<T> |
newEmpty()
Creates a new empty mutable version of the same collection type.
|
default MultiReaderSet<T> |
tap(Procedure<? super T> procedure)
Executes the Procedure for each element in the iterable and returns
this. |
default MultiReaderSet<T> |
with(T element)
This method allows mutable and fixed size collections the ability to add elements to their existing elements.
|
default MultiReaderSet<T> |
withAll(Iterable<? extends T> elements)
This method allows mutable and fixed size collections the ability to add multiple elements to their existing
elements.
|
default MultiReaderSet<T> |
without(T element)
This method allows mutable and fixed size collections the ability to remove elements from their existing elements.
|
default MultiReaderSet<T> |
withoutAll(Iterable<? extends T> elements)
This method allows mutable and fixed size collections the ability to remove multiple elements from their existing
elements.
|
void |
withReadLockAndDelegate(Procedure<? super MutableSet<T>> procedure) |
void |
withWriteLockAndDelegate(Procedure<? super MutableSet<T>> procedure) |
asSynchronized, asUnmodifiable, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, difference, flatCollect, flatCollectWith, groupBy, groupByEach, intersect, partition, partitionWith, powerSet, reject, rejectWith, select, selectInstancesOf, selectWith, symmetricDifference, toImmutable, toImmutableSet, union, zip, zipWithIndexasParallelcartesianProduct, differenceInto, equals, hashCode, intersectInto, isProperSubsetOf, isSubsetOf, symmetricDifferenceInto, unionIntoaddAllIterable, aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, groupByUniqueKey, injectIntoWith, removeAllIterable, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongaggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, 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, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexforEach, forEachWith, forEachWithIndexadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamvoid withReadLockAndDelegate(Procedure<? super MutableSet<T>> procedure)
void withWriteLockAndDelegate(Procedure<? super MutableSet<T>> procedure)
MultiReaderSet<T> newEmpty()
MutableCollectionnewEmpty in interface MutableCollection<T>newEmpty in interface MutableSet<T>MultiReaderSet<T> clone()
clone in interface MutableSet<T>default MultiReaderSet<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 MutableCollection<T>with in interface MutableSet<T>with in interface MutableSetIterable<T>Collection.add(Object)default MultiReaderSet<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 MutableCollection<T>without in interface MutableSet<T>without in interface MutableSetIterable<T>Collection.remove(Object)default MultiReaderSet<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 MutableCollection<T>withAll in interface MutableSet<T>withAll in interface MutableSetIterable<T>Collection.addAll(Collection)default MultiReaderSet<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 MutableCollection<T>withoutAll in interface MutableSet<T>withoutAll in interface MutableSetIterable<T>Collection.removeAll(Collection)default MultiReaderSet<T> tap(Procedure<? super T> procedure)
RichIterablethis.
Example using a Java 8 lambda expression:
RichIterable<Person> tapped =
people.tap(person -> LOGGER.info(person.getName()));
tap in interface MutableCollection<T>tap in interface MutableSet<T>tap in interface MutableSetIterable<T>tap in interface RichIterable<T>tap in interface SetIterable<T>tap in interface UnsortedSetIterable<T>RichIterable.each(Procedure),
RichIterable.forEach(Procedure)Copyright © 2004–2023. All rights reserved.