Interface ICommonsSortedMap<KEYTYPE,VALUETYPE>
-
- Type Parameters:
KEYTYPE- Map key typeVALUETYPE- Map value type
- All Superinterfaces:
ICloneable<ICommonsMap<KEYTYPE,VALUETYPE>>,ICommonsMap<KEYTYPE,VALUETYPE>,Map<KEYTYPE,VALUETYPE>,SortedMap<KEYTYPE,VALUETYPE>
- All Known Subinterfaces:
ICommonsNavigableMap<KEYTYPE,VALUETYPE>
- All Known Implementing Classes:
CommonsTreeMap
public interface ICommonsSortedMap<KEYTYPE,VALUETYPE> extends SortedMap<KEYTYPE,VALUETYPE>, ICommonsMap<KEYTYPE,VALUETYPE>
A specialSortedMapbased interface with extended functionality based onICommonsMap.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ICommonsSortedSet<Map.Entry<KEYTYPE,VALUETYPE>>copyOfEntrySet()default ICommonsSortedSet<KEYTYPE>copyOfKeySet()default ICommonsSortedSet<KEYTYPE>copyOfKeySet(Predicate<? super KEYTYPE> aFilter)Create a copy of all values matching the passed filter.default <K,V>
ICommonsSortedMap<K,V>createInstance()Create a newCommonsTreeMap.default SortedMap<KEYTYPE,VALUETYPE>getAsUnmodifiable()ICommonsSortedMap<KEYTYPE,VALUETYPE>getClone()default KEYTYPEgetFirstKey(KEYTYPE aDefault)Get the first key of this map or the provided default value.default VALUETYPEgetFirstValue(VALUETYPE aDefault)Get the first value of this map or the provided default value.default KEYTYPEgetLastKey()default KEYTYPEgetLastKey(KEYTYPE aDefault)default VALUETYPEgetLastValue()default VALUETYPEgetLastValue(VALUETYPE aDefault)-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsMap
addAll, containsAnyEntry, containsAnyKey, containsAnyValue, copyOfValues, copyOfValues, copyOfValuesMapped, copyOfValuesMapped, findFirstEntry, findFirstKey, findFirstValue, forEach, forEachKey, forEachKey, forEachValue, forEachValue, getFirstEntry, getFirstEntry, getFirstKey, getFirstValue, getSortedByKey, getSortedByValue, getSwappedKeyValues, isNotEmpty, put, putAll, putAll, putAllMapped, putAllMapped, putAllMapped, putIf, putIfNotNull, removeAll, removeIf, removeIfKey, removeIfValue, removeObject, setAll
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
-
-
-
Method Detail
-
createInstance
@Nonnull @ReturnsMutableCopy default <K,V> ICommonsSortedMap<K,V> createInstance()
Create a newCommonsTreeMap.- Specified by:
createInstancein interfaceICommonsMap<KEYTYPE,VALUETYPE>- Type Parameters:
K- Map key typeV- Map value type- Returns:
- A new empty map. Never
null.
-
copyOfKeySet
@Nonnull @ReturnsMutableCopy default ICommonsSortedSet<KEYTYPE> copyOfKeySet()
- Specified by:
copyOfKeySetin interfaceICommonsMap<KEYTYPE,VALUETYPE>- Returns:
- A new non-
nullset with all keys. - See Also:
Map.keySet(),ICommonsMap.copyOfKeySet(Predicate)
-
copyOfKeySet
@Nonnull @ReturnsMutableCopy default ICommonsSortedSet<KEYTYPE> copyOfKeySet(@Nullable Predicate<? super KEYTYPE> aFilter)
Description copied from interface:ICommonsMapCreate a copy of all values matching the passed filter.- Specified by:
copyOfKeySetin interfaceICommonsMap<KEYTYPE,VALUETYPE>- Parameters:
aFilter- The filter to be applied. May benull.- Returns:
- A new non-
nullset with all matching keys. - See Also:
Map.keySet(),ICommonsMap.copyOfKeySet()
-
copyOfEntrySet
@Nonnull @ReturnsMutableCopy default ICommonsSortedSet<Map.Entry<KEYTYPE,VALUETYPE>> copyOfEntrySet()
- Specified by:
copyOfEntrySetin interfaceICommonsMap<KEYTYPE,VALUETYPE>- Returns:
- A new non-
nullcopy of the entry set.
-
getFirstKey
@Nullable default KEYTYPE getFirstKey(@Nullable KEYTYPE aDefault)
Description copied from interface:ICommonsMapGet the first key of this map or the provided default value.- Specified by:
getFirstKeyin interfaceICommonsMap<KEYTYPE,VALUETYPE>- Parameters:
aDefault- The default value to be returned if this map is empty. May benull.- Returns:
- The provided default value if the map is empty, the first key otherwise.
- See Also:
ICommonsMap.getFirstKey()
-
getFirstValue
@Nullable default VALUETYPE getFirstValue(@Nullable VALUETYPE aDefault)
Description copied from interface:ICommonsMapGet the first value of this map or the provided default value.- Specified by:
getFirstValuein interfaceICommonsMap<KEYTYPE,VALUETYPE>- Parameters:
aDefault- The default value to be returned if this map is empty. May benull.- Returns:
- The provided default value if the map is empty, the first value otherwise.
- See Also:
ICommonsMap.getFirstValue()
-
getAsUnmodifiable
@Nonnull @CodingStyleguideUnaware default SortedMap<KEYTYPE,VALUETYPE> getAsUnmodifiable()
- Specified by:
getAsUnmodifiablein interfaceICommonsMap<KEYTYPE,VALUETYPE>- Returns:
- An unmodifiable version of this map. Never
null. - See Also:
Collections
-
getClone
@Nonnull @ReturnsMutableCopy ICommonsSortedMap<KEYTYPE,VALUETYPE> getClone()
- Specified by:
getClonein interfaceICloneable<KEYTYPE>- Returns:
- A 100% deep-copy of the implementing class.
-
-