class
NgLib::SqrtMap(K, V)
- NgLib::SqrtMap(K, V)
- Reference
- Object
Included Modules
- Enumerable({K, V})
- Iterable({K, V})
Defined in:
nglib/data_structure/sortedcontainers/sqrt_map.crConstructors
- .new(hash : Hash(K, V))
- .new(default_value : V)
- .new(&block : self, K -> V)
- .new(block : self, K -> V | Nil = nil)
Class Method Summary
Instance Method Summary
- #[](key : K) : V
- #[]=(key : K, value : V) : V
- #[]?(key : K) : V | Nil
- #at(index : Int) : Tuple(K, V)
-
#at(index : Int, &)
Returns the key-value at the index-th.
-
#at?(index : Int) : Tuple(K, V) | Nil
Like
#at, but returnsnilif trying to access an key-value outside the set's range. - #delete(key : K) : V | Nil
-
#each(&) : Nil
Must yield this collection's elements to the block.
-
#each : Iterator(Tuple(K, V))
Must return an
Iteratorover the elements in this collection. - #fetch(key : K, &)
- #fetch(key : K, default_value)
- #fetch_at(index : Int, &)
- #fetch_at(index : Int, default_value)
- #has_key?(key : K) : Bool
- #invert : SqrtMap(V, K)
-
#key_at(index : Int) : K
Returns the key at the index-th.
-
#key_at?(index : Int) : K | Nil
Like
#at, but returnsnilif trying to access an key outside the set's range. - #key_for(value) : K
- #key_for(value, &)
- #key_for?(value) : K | Nil
- #keys : Array(K)
- #put(key : K, value : V, &)
- #size(*args, **options)
- #size(*args, **options, &)
- #unsafe_fetch(index : Int) : Tuple(K, V)
- #update(key : K, & : V -> V) : V
-
#value_at(index : Int) : V
Returns the value at the index-th.
-
#value_at?(index : Int) : V | Nil
Like
#at, but returnsnilif trying to access an value outside the set's range. - #values : Array(V)
- #values_at(*indices : Int)
- #values_by_key(*keys : K)
Constructor Detail
Class Method Detail
Instance Method Detail
Like #at, but returns nil
if trying to access an key-value outside the set's range.
Must yield this collection's elements to the block.
Must return an Iterator over the elements in this collection.
Like #at, but returns nil
if trying to access an key outside the set's range.
Like #at, but returns nil
if trying to access an value outside the set's range.