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 specialSetinterface with extended functionality based onICommonsCollection.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <T> ICommonsSet<T>createInstance()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>getAsUnmodifiable()default booleanreplace(ELEMENTTYPE aElement)Replace an existing item in this Set.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface com.helger.commons.lang.ICloneable
getClone
-
Methods 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, setAllMapped
-
Methods 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, getCount
-
Methods inherited from interface com.helger.commons.lang.IHasSize
isEmpty, isNotEmpty, size
-
-
-
-
Method Detail
-
createInstance
@Nonnull @ReturnsMutableCopy default <T> ICommonsSet<T> 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
default boolean replace(@Nullable ELEMENTTYPE aElement)
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
@Nonnull @CodingStyleguideUnaware default Set<ELEMENTTYPE> getAsUnmodifiable()
- Specified by:
getAsUnmodifiablein interfaceICommonsCollection<ELEMENTTYPE>- Returns:
- An unmodifiable version of this collection. Never
null. - See Also:
Collections
-
-