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> SequencedMap<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 special
SortedMap based interface with extended functionality based
on ICommonsMap.- Author:
- Philip Helger
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault ICommonsSortedSet<Map.Entry<KEYTYPE, VALUETYPE>> default ICommonsSortedSet<KEYTYPE> default ICommonsSortedSet<KEYTYPE> copyOfKeySet(Predicate<? super KEYTYPE> aFilter) Create a copy of all values matching the passed filter.default <K,V> ICommonsSortedMap <K, V> Create a newCommonsTreeMap.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 KEYTYPEdefault KEYTYPEgetLastKey(KEYTYPE aDefault) default VALUETYPEdefault 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, setAllMethods 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, sizeMethods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry, sequencedEntrySet, sequencedKeySet, sequencedValues
-
Method Details
-
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
- Specified by:
copyOfKeySetin interfaceICommonsMap<KEYTYPE,VALUETYPE> - Returns:
- A new non-
nullset with all keys. - See Also:
-
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:
-
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
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:
-
getFirstValue
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:
-
getLastKey
-
getLastKey
-
getLastValue
-
getLastValue
-
getAsUnmodifiable
- Specified by:
getAsUnmodifiablein interfaceICommonsMap<KEYTYPE,VALUETYPE> - Returns:
- An unmodifiable version of this map. Never
null. - See Also:
-
getClone
- Specified by:
getClonein interfaceICloneable<KEYTYPE>- Returns:
- A 100% deep-copy of the implementing class.
-