Package org.apache.iceberg.util
Class CharSequenceMap<V>
java.lang.Object
org.apache.iceberg.util.CharSequenceMap<V>
- Type Parameters:
V
- the type of values
- All Implemented Interfaces:
Serializable
,Map<CharSequence,
V>
A map that uses char sequences as keys.
This implementation wraps provided keys into CharSequenceWrapper
for consistent
hashing and equals behavior. This ensures that objects of different types that represent the same
sequence of characters are treated as equal keys in the map.
Note: This map is not designed for concurrent modification by multiple threads. However, it supports safe concurrent reads, assuming there are no concurrent writes.
Note: This map does not support null keys.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
computeIfAbsent
(CharSequence key, Supplier<V> valueSupplier) boolean
containsKey
(Object key) boolean
containsValue
(Object value) static <T> CharSequenceMap
<T> create()
entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
put
(CharSequence key, V value) void
putAll
(Map<? extends CharSequence, ? extends V> otherMap) int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
create
-
size
public int size()- Specified by:
size
in interfaceMap<CharSequence,
V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceMap<CharSequence,
V>
-
containsKey
- Specified by:
containsKey
in interfaceMap<CharSequence,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<CharSequence,
V>
-
get
- Specified by:
get
in interfaceMap<CharSequence,
V>
-
put
- Specified by:
put
in interfaceMap<CharSequence,
V>
-
remove
- Specified by:
remove
in interfaceMap<CharSequence,
V>
-
putAll
- Specified by:
putAll
in interfaceMap<CharSequence,
V>
-
clear
public void clear()- Specified by:
clear
in interfaceMap<CharSequence,
V>
-
keySet
- Specified by:
keySet
in interfaceMap<CharSequence,
V>
-
values
- Specified by:
values
in interfaceMap<CharSequence,
V>
-
entrySet
- Specified by:
entrySet
in interfaceMap<CharSequence,
V>
-
computeIfAbsent
-
equals
-
hashCode
public int hashCode() -
toString
-