Class AbstractMutableSet<T>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<T>
-
- org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection<T>
-
- org.eclipse.collections.impl.set.mutable.AbstractMutableSet<T>
-
- All Implemented Interfaces:
Cloneable
,Iterable<T>
,Collection<T>
,Set<T>
,MutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
,MutableSet<T>
,MutableSetIterable<T>
,SetIterable<T>
,UnsortedSetIterable<T>
- Direct Known Subclasses:
BoxedMutableBooleanSet
,BoxedMutableByteSet
,BoxedMutableCharSet
,BoxedMutableDoubleSet
,BoxedMutableFloatSet
,BoxedMutableIntSet
,BoxedMutableLongSet
,BoxedMutableShortSet
public abstract class AbstractMutableSet<T> extends AbstractMutableCollection<T> implements MutableSet<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractMutableSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MutableSet<T>
asSynchronized()
MutableSet<T>
asUnmodifiable()
<B> LazyIterable<Pair<T,B>>
cartesianProduct(SetIterable<B> set)
MutableSet<T>
clone()
<V> MutableSet<V>
collect(Function<? super T,? extends V> function)
<V> MutableSet<V>
collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
<P,V>
MutableSet<V>collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
MutableSet<T>
difference(SetIterable<? extends T> subtrahendSet)
<R extends Set<T>>
RdifferenceInto(SetIterable<? extends T> subtrahendSet, R targetSet)
<V> MutableSet<V>
flatCollect(Function<? super T,? extends Iterable<V>> function)
<V> UnifiedSetMultimap<V,T>
groupBy(Function<? super T,? extends V> function)
<V> UnifiedSetMultimap<V,T>
groupByEach(Function<? super T,? extends Iterable<V>> function)
MutableSet<T>
intersect(SetIterable<? extends T> set)
<R extends Set<T>>
RintersectInto(SetIterable<? extends T> set, R targetSet)
boolean
isProperSubsetOf(SetIterable<? extends T> candidateSuperset)
boolean
isSubsetOf(SetIterable<? extends T> candidateSuperset)
MutableSet<T>
newEmpty()
PartitionMutableSet<T>
partition(Predicate<? super T> predicate)
<P> PartitionMutableSet<T>
partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableSet<UnsortedSetIterable<T>>
powerSet()
MutableSet<T>
reject(Predicate<? super T> predicate)
<P> MutableSet<T>
rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
removeAllIterable(Iterable<?> iterable)
MutableSet<T>
select(Predicate<? super T> predicate)
<S> MutableSet<S>
selectInstancesOf(Class<S> clazz)
<P> MutableSet<T>
selectWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableSet<T>
symmetricDifference(SetIterable<? extends T> setB)
<R extends Set<T>>
RsymmetricDifferenceInto(SetIterable<? extends T> set, R targetSet)
MutableSet<T>
tap(Procedure<? super T> procedure)
ImmutableSet<T>
toImmutable()
MutableSet<T>
union(SetIterable<? extends T> set)
<R extends Set<T>>
RunionInto(SetIterable<? extends T> set, R targetSet)
<S> MutableSet<Pair<T,S>>
zip(Iterable<S> that)
Deprecated.in 6.0.MutableSet<Pair<T,Integer>>
zipWithIndex()
Deprecated.in 6.0.-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection
add, addAll, addAllIterable, chunk, countBy, countByEach, countByWith, groupByUniqueKey, injectIntoWith, reduce, remove, removeAll, removeIf, removeIfWith, retainAll, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, asLazy, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEach, forEachWith, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, max, max, maxBy, min, min, minBy, noneSatisfy, noneSatisfyWith, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.collection.MutableCollection
addAllIterable, aggregateBy, aggregateInPlaceBy, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, countBy, countByEach, countByWith, flatCollectWith, groupByUniqueKey, injectIntoWith, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong
-
Methods inherited from interface org.eclipse.collections.api.set.MutableSet
collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollectWith, toImmutableSet, with, withAll, without, withoutAll
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, 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, zipWithIndex
-
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.set.SetIterable
equals, hashCode
-
Methods inherited from interface org.eclipse.collections.api.set.UnsortedSetIterable
asParallel
-
-
-
-
Method Detail
-
clone
public MutableSet<T> clone()
- Specified by:
clone
in interfaceMutableSet<T>
-
newEmpty
public MutableSet<T> newEmpty()
- Specified by:
newEmpty
in interfaceMutableCollection<T>
- Specified by:
newEmpty
in interfaceMutableSet<T>
-
tap
public MutableSet<T> tap(Procedure<? super T> procedure)
- Specified by:
tap
in interfaceMutableCollection<T>
- Specified by:
tap
in interfaceMutableSet<T>
- Specified by:
tap
in interfaceMutableSetIterable<T>
- Specified by:
tap
in interfaceRichIterable<T>
- Specified by:
tap
in interfaceSetIterable<T>
- Specified by:
tap
in interfaceUnsortedSetIterable<T>
-
select
public MutableSet<T> select(Predicate<? super T> predicate)
- Specified by:
select
in interfaceMutableCollection<T>
- Specified by:
select
in interfaceMutableSet<T>
- Specified by:
select
in interfaceMutableSetIterable<T>
- Specified by:
select
in interfaceRichIterable<T>
- Specified by:
select
in interfaceSetIterable<T>
- Specified by:
select
in interfaceUnsortedSetIterable<T>
-
selectWith
public <P> MutableSet<T> selectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
selectWith
in interfaceMutableCollection<T>
- Specified by:
selectWith
in interfaceMutableSet<T>
- Specified by:
selectWith
in interfaceMutableSetIterable<T>
- Specified by:
selectWith
in interfaceRichIterable<T>
- Specified by:
selectWith
in interfaceSetIterable<T>
- Specified by:
selectWith
in interfaceUnsortedSetIterable<T>
-
reject
public MutableSet<T> reject(Predicate<? super T> predicate)
- Specified by:
reject
in interfaceMutableCollection<T>
- Specified by:
reject
in interfaceMutableSet<T>
- Specified by:
reject
in interfaceMutableSetIterable<T>
- Specified by:
reject
in interfaceRichIterable<T>
- Specified by:
reject
in interfaceSetIterable<T>
- Specified by:
reject
in interfaceUnsortedSetIterable<T>
-
rejectWith
public <P> MutableSet<T> rejectWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
rejectWith
in interfaceMutableCollection<T>
- Specified by:
rejectWith
in interfaceMutableSet<T>
- Specified by:
rejectWith
in interfaceMutableSetIterable<T>
- Specified by:
rejectWith
in interfaceRichIterable<T>
- Specified by:
rejectWith
in interfaceSetIterable<T>
- Specified by:
rejectWith
in interfaceUnsortedSetIterable<T>
-
partition
public PartitionMutableSet<T> partition(Predicate<? super T> predicate)
- Specified by:
partition
in interfaceMutableCollection<T>
- Specified by:
partition
in interfaceMutableSet<T>
- Specified by:
partition
in interfaceMutableSetIterable<T>
- Specified by:
partition
in interfaceRichIterable<T>
- Specified by:
partition
in interfaceSetIterable<T>
-
partitionWith
public <P> PartitionMutableSet<T> partitionWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
partitionWith
in interfaceMutableCollection<T>
- Specified by:
partitionWith
in interfaceMutableSet<T>
- Specified by:
partitionWith
in interfaceMutableSetIterable<T>
- Specified by:
partitionWith
in interfaceRichIterable<T>
- Specified by:
partitionWith
in interfaceSetIterable<T>
-
selectInstancesOf
public <S> MutableSet<S> selectInstancesOf(Class<S> clazz)
- Specified by:
selectInstancesOf
in interfaceMutableCollection<T>
- Specified by:
selectInstancesOf
in interfaceMutableSet<T>
- Specified by:
selectInstancesOf
in interfaceMutableSetIterable<T>
- Specified by:
selectInstancesOf
in interfaceRichIterable<T>
- Specified by:
selectInstancesOf
in interfaceSetIterable<T>
- Specified by:
selectInstancesOf
in interfaceUnsortedSetIterable<T>
-
collect
public <V> MutableSet<V> collect(Function<? super T,? extends V> function)
- Specified by:
collect
in interfaceMutableCollection<T>
- Specified by:
collect
in interfaceMutableSet<T>
- Specified by:
collect
in interfaceRichIterable<T>
- Specified by:
collect
in interfaceUnsortedSetIterable<T>
-
flatCollect
public <V> MutableSet<V> flatCollect(Function<? super T,? extends Iterable<V>> function)
- Specified by:
flatCollect
in interfaceMutableCollection<T>
- Specified by:
flatCollect
in interfaceMutableSet<T>
- Specified by:
flatCollect
in interfaceRichIterable<T>
- Specified by:
flatCollect
in interfaceUnsortedSetIterable<T>
-
collectWith
public <P,V> MutableSet<V> collectWith(Function2<? super T,? super P,? extends V> function, P parameter)
- Specified by:
collectWith
in interfaceMutableCollection<T>
- Specified by:
collectWith
in interfaceMutableSet<T>
- Specified by:
collectWith
in interfaceRichIterable<T>
- Specified by:
collectWith
in interfaceUnsortedSetIterable<T>
-
collectIf
public <V> MutableSet<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
- Specified by:
collectIf
in interfaceMutableCollection<T>
- Specified by:
collectIf
in interfaceMutableSet<T>
- Specified by:
collectIf
in interfaceRichIterable<T>
- Specified by:
collectIf
in interfaceUnsortedSetIterable<T>
-
groupBy
public <V> UnifiedSetMultimap<V,T> groupBy(Function<? super T,? extends V> function)
- Specified by:
groupBy
in interfaceMutableCollection<T>
- Specified by:
groupBy
in interfaceMutableSet<T>
- Specified by:
groupBy
in interfaceMutableSetIterable<T>
- Specified by:
groupBy
in interfaceRichIterable<T>
- Specified by:
groupBy
in interfaceUnsortedSetIterable<T>
-
groupByEach
public <V> UnifiedSetMultimap<V,T> groupByEach(Function<? super T,? extends Iterable<V>> function)
- Specified by:
groupByEach
in interfaceMutableCollection<T>
- Specified by:
groupByEach
in interfaceMutableSet<T>
- Specified by:
groupByEach
in interfaceMutableSetIterable<T>
- Specified by:
groupByEach
in interfaceRichIterable<T>
- Specified by:
groupByEach
in interfaceUnsortedSetIterable<T>
-
asUnmodifiable
public MutableSet<T> asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableCollection<T>
- Specified by:
asUnmodifiable
in interfaceMutableSet<T>
-
asSynchronized
public MutableSet<T> asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableCollection<T>
- Specified by:
asSynchronized
in interfaceMutableSet<T>
-
toImmutable
public ImmutableSet<T> toImmutable()
- Specified by:
toImmutable
in interfaceMutableCollection<T>
- Specified by:
toImmutable
in interfaceMutableSet<T>
- Specified by:
toImmutable
in interfaceSetIterable<T>
- Specified by:
toImmutable
in interfaceUnsortedSetIterable<T>
-
zip
@Deprecated public <S> MutableSet<Pair<T,S>> zip(Iterable<S> that)
Deprecated.in 6.0. UseOrderedIterable.zip(Iterable)
instead.- Specified by:
zip
in interfaceMutableCollection<T>
- Specified by:
zip
in interfaceMutableSet<T>
- Specified by:
zip
in interfaceMutableSetIterable<T>
- Specified by:
zip
in interfaceRichIterable<T>
- Specified by:
zip
in interfaceUnsortedSetIterable<T>
-
zipWithIndex
@Deprecated public MutableSet<Pair<T,Integer>> zipWithIndex()
Deprecated.in 6.0. UseOrderedIterable.zipWithIndex()
instead.- Specified by:
zipWithIndex
in interfaceMutableCollection<T>
- Specified by:
zipWithIndex
in interfaceMutableSet<T>
- Specified by:
zipWithIndex
in interfaceMutableSetIterable<T>
- Specified by:
zipWithIndex
in interfaceRichIterable<T>
- Specified by:
zipWithIndex
in interfaceSetIterable<T>
- Specified by:
zipWithIndex
in interfaceUnsortedSetIterable<T>
-
removeAllIterable
public boolean removeAllIterable(Iterable<?> iterable)
- Specified by:
removeAllIterable
in interfaceMutableCollection<T>
- Overrides:
removeAllIterable
in classAbstractMutableCollection<T>
-
union
public MutableSet<T> union(SetIterable<? extends T> set)
- Specified by:
union
in interfaceMutableSet<T>
- Specified by:
union
in interfaceSetIterable<T>
- Specified by:
union
in interfaceUnsortedSetIterable<T>
-
unionInto
public <R extends Set<T>> R unionInto(SetIterable<? extends T> set, R targetSet)
- Specified by:
unionInto
in interfaceSetIterable<T>
-
intersect
public MutableSet<T> intersect(SetIterable<? extends T> set)
- Specified by:
intersect
in interfaceMutableSet<T>
- Specified by:
intersect
in interfaceSetIterable<T>
- Specified by:
intersect
in interfaceUnsortedSetIterable<T>
-
intersectInto
public <R extends Set<T>> R intersectInto(SetIterable<? extends T> set, R targetSet)
- Specified by:
intersectInto
in interfaceSetIterable<T>
-
difference
public MutableSet<T> difference(SetIterable<? extends T> subtrahendSet)
- Specified by:
difference
in interfaceMutableSet<T>
- Specified by:
difference
in interfaceSetIterable<T>
- Specified by:
difference
in interfaceUnsortedSetIterable<T>
-
differenceInto
public <R extends Set<T>> R differenceInto(SetIterable<? extends T> subtrahendSet, R targetSet)
- Specified by:
differenceInto
in interfaceSetIterable<T>
-
symmetricDifference
public MutableSet<T> symmetricDifference(SetIterable<? extends T> setB)
- Specified by:
symmetricDifference
in interfaceMutableSet<T>
- Specified by:
symmetricDifference
in interfaceSetIterable<T>
- Specified by:
symmetricDifference
in interfaceUnsortedSetIterable<T>
-
symmetricDifferenceInto
public <R extends Set<T>> R symmetricDifferenceInto(SetIterable<? extends T> set, R targetSet)
- Specified by:
symmetricDifferenceInto
in interfaceSetIterable<T>
-
isSubsetOf
public boolean isSubsetOf(SetIterable<? extends T> candidateSuperset)
- Specified by:
isSubsetOf
in interfaceSetIterable<T>
-
isProperSubsetOf
public boolean isProperSubsetOf(SetIterable<? extends T> candidateSuperset)
- Specified by:
isProperSubsetOf
in interfaceSetIterable<T>
-
powerSet
public MutableSet<UnsortedSetIterable<T>> powerSet()
- Specified by:
powerSet
in interfaceMutableSet<T>
- Specified by:
powerSet
in interfaceUnsortedSetIterable<T>
-
cartesianProduct
public <B> LazyIterable<Pair<T,B>> cartesianProduct(SetIterable<B> set)
- Specified by:
cartesianProduct
in interfaceSetIterable<T>
-
-