Package org.eclipse.collections.impl.set
Class AbstractUnifiedSet<T>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<T>
-
- org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection<T>
-
- org.eclipse.collections.impl.set.AbstractUnifiedSet<T>
-
- All Implemented Interfaces:
Cloneable
,Iterable<T>
,Collection<T>
,Set<T>
,MutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
,MutableSet<T>
,MutableSetIterable<T>
,Pool<T>
,SetIterable<T>
,UnsortedSetIterable<T>
,BatchIterable<T>
- Direct Known Subclasses:
UnifiedSet
,UnifiedSetWithHashingStrategy
public abstract class AbstractUnifiedSet<T> extends AbstractMutableCollection<T> implements MutableSet<T>, Pool<T>, BatchIterable<T>
-
-
Constructor Summary
Constructors Constructor Description AbstractUnifiedSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
allSatisfy(Predicate<? super T> predicate)
<P> boolean
allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
boolean
anySatisfy(Predicate<? super T> predicate)
<P> boolean
anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableSet<T>
asSynchronized()
MutableSet<T>
asUnmodifiable()
<B> LazyIterable<Pair<T,B>>
cartesianProduct(SetIterable<B> set)
RichIterable<RichIterable<T>>
chunk(int size)
abstract MutableSet<T>
clone()
<V> UnifiedSet<V>
collect(Function<? super T,? extends V> function)
<V> UnifiedSet<V>
collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)
<P,A>
UnifiedSet<A>collectWith(Function2<? super T,? super P,? extends A> function, P parameter)
T
detect(Predicate<? super T> predicate)
Optional<T>
detectOptional(Predicate<? super T> predicate)
MutableSet<T>
difference(SetIterable<? extends T> subtrahendSet)
<R extends Set<T>>
RdifferenceInto(SetIterable<? extends T> subtrahendSet, R targetSet)
<V> UnifiedSet<V>
flatCollect(Function<? super T,? extends Iterable<V>> function)
int
getBatchCount(int batchSize)
<V> MutableMap<V,T>
groupByUniqueKey(Function<? super T,? extends V> function)
<IV,P>
IVinjectIntoWith(IV injectValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)
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)
abstract MutableSet<T>
newEmpty(int size)
boolean
noneSatisfy(Predicate<? super T> predicate)
<P> boolean
noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
MutableSet<UnsortedSetIterable<T>>
powerSet()
boolean
removeAllIterable(Iterable<?> iterable)
boolean
retainAll(Collection<?> collection)
MutableSet<T>
symmetricDifference(SetIterable<? extends T> setB)
<R extends Set<T>>
RsymmetricDifferenceInto(SetIterable<? extends T> set, R targetSet)
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, countBy, countByEach, countByWith, reduce, remove, removeAll, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLong
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
appendString, appendString, asLazy, collect, collectIf, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEach, forEachWith, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, max, max, maxBy, min, min, minBy, 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 org.eclipse.collections.impl.parallel.BatchIterable
batchForEach, forEach, size
-
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, partition, partitionWith, reject, rejectWith, removeIf, removeIfWith, retainAllIterable, select, selectAndRejectWith, selectInstancesOf, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, tap, toImmutable
-
Methods inherited from interface org.eclipse.collections.api.set.MutableSet
collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollectWith, groupBy, groupByEach, newEmpty, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, toImmutable, toImmutableSet, with, withAll, without, withoutAll
-
Methods inherited from interface org.eclipse.collections.api.set.Pool
clear, get, put, removeFromPool, size
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, appendString, appendString, appendString, asLazy, 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, detectIfNone, 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, 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, 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 abstract MutableSet<T> clone()
- Specified by:
clone
in interfaceMutableSet<T>
-
newEmpty
public abstract MutableSet<T> newEmpty(int size)
-
getBatchCount
public int getBatchCount(int batchSize)
- Specified by:
getBatchCount
in interfaceBatchIterable<T>
-
collect
public <V> UnifiedSet<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> UnifiedSet<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,A> UnifiedSet<A> collectWith(Function2<? super T,? super P,? extends A> 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> UnifiedSet<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>
-
detect
public T detect(Predicate<? super T> predicate)
- Specified by:
detect
in interfaceRichIterable<T>
- Overrides:
detect
in classAbstractRichIterable<T>
-
detectOptional
public Optional<T> detectOptional(Predicate<? super T> predicate)
- Specified by:
detectOptional
in interfaceRichIterable<T>
- Overrides:
detectOptional
in classAbstractRichIterable<T>
-
anySatisfy
public boolean anySatisfy(Predicate<? super T> predicate)
- Specified by:
anySatisfy
in interfaceRichIterable<T>
- Overrides:
anySatisfy
in classAbstractRichIterable<T>
-
anySatisfyWith
public <P> boolean anySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
anySatisfyWith
in interfaceRichIterable<T>
- Overrides:
anySatisfyWith
in classAbstractRichIterable<T>
-
allSatisfy
public boolean allSatisfy(Predicate<? super T> predicate)
- Specified by:
allSatisfy
in interfaceRichIterable<T>
- Overrides:
allSatisfy
in classAbstractRichIterable<T>
-
allSatisfyWith
public <P> boolean allSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
allSatisfyWith
in interfaceRichIterable<T>
- Overrides:
allSatisfyWith
in classAbstractRichIterable<T>
-
noneSatisfy
public boolean noneSatisfy(Predicate<? super T> predicate)
- Specified by:
noneSatisfy
in interfaceRichIterable<T>
- Overrides:
noneSatisfy
in classAbstractRichIterable<T>
-
noneSatisfyWith
public <P> boolean noneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)
- Specified by:
noneSatisfyWith
in interfaceRichIterable<T>
- Overrides:
noneSatisfyWith
in classAbstractRichIterable<T>
-
injectIntoWith
public <IV,P> IV injectIntoWith(IV injectValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)
- Specified by:
injectIntoWith
in interfaceMutableCollection<T>
- Overrides:
injectIntoWith
in classAbstractMutableCollection<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>
-
removeAllIterable
public boolean removeAllIterable(Iterable<?> iterable)
- Specified by:
removeAllIterable
in interfaceMutableCollection<T>
- Overrides:
removeAllIterable
in classAbstractMutableCollection<T>
-
retainAll
public boolean retainAll(Collection<?> collection)
- Specified by:
retainAll
in interfaceCollection<T>
- Specified by:
retainAll
in interfaceSet<T>
- Overrides:
retainAll
in classAbstractMutableCollection<T>
-
groupByUniqueKey
public <V> MutableMap<V,T> groupByUniqueKey(Function<? super T,? extends V> function)
- Specified by:
groupByUniqueKey
in interfaceMutableCollection<T>
- Specified by:
groupByUniqueKey
in interfaceRichIterable<T>
- Overrides:
groupByUniqueKey
in classAbstractMutableCollection<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>
-
chunk
public RichIterable<RichIterable<T>> chunk(int size)
- Specified by:
chunk
in interfaceRichIterable<T>
- Overrides:
chunk
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>
-
-