Interface ICommonsSet<ELEMENTTYPE>
- Type Parameters:
ELEMENTTYPE- The data type of the elements in the list.
- All Superinterfaces:
Collection<ELEMENTTYPE>,ICloneable<ICommonsSet<ELEMENTTYPE>>,ICommonsCollection<ELEMENTTYPE>,ICommonsIterable<ELEMENTTYPE>,IHasSize,Iterable<ELEMENTTYPE>,Set<ELEMENTTYPE>
- All Known Subinterfaces:
ICommonsNavigableSet<ELEMENTTYPE>,ICommonsOrderedSet<ELEMENTTYPE>,ICommonsSortedSet<ELEMENTTYPE>
- All Known Implementing Classes:
CommonsCopyOnWriteArraySet,CommonsHashSet,CommonsLinkedHashSet,CommonsTreeSet,LRUSet
public interface ICommonsSet<ELEMENTTYPE>
extends Set<ELEMENTTYPE>, ICommonsCollection<ELEMENTTYPE>, ICloneable<ICommonsSet<ELEMENTTYPE>>
A special
Set interface with extended functionality based on
ICommonsCollection.- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> ICommonsSet<T> Create a new empty set.default ICommonsSet<ELEMENTTYPE> getAll(Predicate<? super ELEMENTTYPE> aFilter) default <DSTTYPE extends ELEMENTTYPE>
ICommonsSet<DSTTYPE> getAllInstanceOf(Class<DSTTYPE> aDstClass) default <DSTTYPE> ICommonsSet<DSTTYPE> getAllMapped(Function<? super ELEMENTTYPE, DSTTYPE> aMapper) default <DSTTYPE> ICommonsSet<DSTTYPE> getAllMapped(Predicate<? super ELEMENTTYPE> aFilter, Function<? super ELEMENTTYPE, DSTTYPE> aMapper) default Set<ELEMENTTYPE> default booleanreplace(ELEMENTTYPE aElement) Replace an existing item in this Set.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface com.helger.commons.lang.ICloneable
getCloneMethods inherited from interface com.helger.commons.collection.impl.ICommonsCollection
addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addIf, addIfNotNull, addObject, getAtIndex, getAtIndex, getAtIndex, getAtIndex, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getCopyAsList, getCount, getSorted, iterator2, removeAll, removeObject, set, setAll, setAll, setAllMapped, setAllMappedMethods inherited from interface com.helger.commons.collection.impl.ICommonsIterable
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCountMethods inherited from interface com.helger.commons.lang.IHasSize
isEmpty, isNotEmpty, size
-
Method Details
-
createInstance
Create a new empty set. Overwrite this if you don't want to useCommonsHashSet.- Type Parameters:
T- Set element type- Returns:
- A new empty set. Never
null.
-
getAll
@Nonnull @ReturnsMutableCopy default ICommonsSet<ELEMENTTYPE> getAll(@Nullable Predicate<? super ELEMENTTYPE> aFilter) -
getAllMapped
@Nonnull @ReturnsMutableCopy default <DSTTYPE> ICommonsSet<DSTTYPE> getAllMapped(@Nonnull Function<? super ELEMENTTYPE, DSTTYPE> aMapper) -
getAllMapped
@Nonnull @ReturnsMutableCopy default <DSTTYPE> ICommonsSet<DSTTYPE> getAllMapped(@Nullable Predicate<? super ELEMENTTYPE> aFilter, @Nonnull Function<? super ELEMENTTYPE, DSTTYPE> aMapper) -
getAllInstanceOf
@Nonnull @ReturnsMutableCopy default <DSTTYPE extends ELEMENTTYPE> ICommonsSet<DSTTYPE> getAllInstanceOf(@Nonnull Class<DSTTYPE> aDstClass) -
replace
Replace an existing item in this Set.- Parameters:
aElement- The new element to be added.- Returns:
trueif a previous item was removed,falseif this element was simply added.
-
getAsUnmodifiable
- Specified by:
getAsUnmodifiablein interfaceICommonsCollection<ELEMENTTYPE>- Returns:
- An unmodifiable version of this collection. Never
null. - See Also:
-