Map
classin packageklyn.collections
public class Map<K, V> extends Object implements MapCollection<K, V>:
└ Map
All Implemented Interfaces: MapCollection

Balanced binary tree map.

Native operator mapping:

  • operator[] is mapped to the native klyn_collections_Map_operator_index.
  • operator== is mapped to the native klyn_collections_Map_operator_eq.
  • operator!= is mapped to the native klyn_collections_Map_operator_ne.
Properties
Modifier and Type Member Description
public readonly native property size
size as ULong
Number of entries stored in the map.
Inherited Properties
propertyInherited Properties from Object: type
propertyInherited Properties from MapCollection: size
Constructors
Modifier and Type Member Description
public Map
Map():
No summary.
Methods
Modifier and Type Member Description
public native clear
clear() as Void
Clears all entries.
public native containsValue
containsValue(value as V) as Boolean
Returns true if the value exists.
public get
get<R>(key as K, defaultValue as R) as R:
Returns the value associated with the key, or the provided default value when the key is absent.
public native items
items() as IList<Tuple<K, V> >
Returns the items as a list of tuples.
public native keys
keys() as IList<K>
Returns the keys as a list.
public native remove
remove(key as K) as Boolean
Removes an entry.
public native override toString
toString() as String
Returns a normalized textual representation of map entries.
public native values
values() as IList<V>
Returns the values as a list.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml
methodInherited Methods from MapCollection: clear, containsValue, get, items, keys, remove, values
Operators
Modifier and Type Member Description
public native operator in(key as K) as Boolean Returns true if the key exists.
public native static operator!=(readonly notnull left as Map, readonly notnull right as Map) as Boolean Structural inequality between two maps.
public native static operator==(readonly notnull left as Map, readonly notnull right as Map) as Boolean Structural equality between two maps.
public native operator[](key as K) as V Gets or sets the value associated with the key.
Inherited Operators
operatorInherited Operators from MapCollection: operator in(key as K) as Boolean, operator[](key as K) as V