@Public public final class GenericMap extends Object implements InternalMap, Serializable
MapType
or MultisetType
.
GenericMap
is a generic implementation of InternalMap
which wraps regular Java
maps.
Note: All keys and values of this data structure must be internal data structures. All keys
must be of the same type; same for values. See InternalRow
for more information about
internal data structures.
Both keys and values can contain null for representing nullability.
Constructor and Description |
---|
GenericMap(Map<?,?> map)
Creates an instance of
GenericMap using the given Java map. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Object |
get(Object key)
Returns the value to which the specified key is mapped, or
null if this map contains
no mapping for the key. |
int |
hashCode() |
InternalArray |
keyArray()
Returns an array view of the keys contained in this map.
|
int |
size()
Returns the number of key-value mappings in this map.
|
InternalArray |
valueArray()
Returns an array view of the values contained in this map.
|
public GenericMap(Map<?,?> map)
GenericMap
using the given Java map.
Note: All keys and values of the map must be internal data structures.
public Object get(Object key)
null
if this map contains
no mapping for the key. The returned value is in internal data structure.public int size()
InternalMap
size
in interface InternalMap
public InternalArray keyArray()
InternalMap
A key-value pair has the same index in the key array and value array.
keyArray
in interface InternalMap
public InternalArray valueArray()
InternalMap
A key-value pair has the same index in the key array and value array.
valueArray
in interface InternalMap
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.