class Immutable::Map::Trie(K, V)
- Immutable::Map::Trie(K, V)
- Reference
- Object
Included Modules
- Enumerable({K, V})
Defined in:
immutable/map/trie.crConstant Summary
-
BITMAP_MASK =
((2_u64 ** BLOCK_SIZE) - 1_u64)
-
BITS_PER_LEVEL =
5_u64
-
BLOCK_SIZE =
2_u64 ** BITS_PER_LEVEL
-
INDEX_MASK =
BLOCK_SIZE - 1_u64
Constructors
Class Method Summary
Instance Method Summary
- #clear_owner!
- #delete(key : K) : Trie(K, V)
- #delete!(key : K, from : UInt64) : Trie(K, V)
-
#each(&)
Must yield this collection's elements to the block.
- #each
-
#empty?
Returns
true
ifself
is empty,false
otherwise. - #fetch(key : K, &block : K -> _)
- #find_entry(key : K) : Entry(K, V) | Nil
- #get(key : K) : V
- #has_key?(key : K) : Bool
- #levels
- #set(key : K, value : V) : Trie(K, V)
- #set!(key : K, value : V, from : UInt64) : Trie(K, V)
-
#size
Returns the number of elements in the collection.
Constructor Detail
def self.new(children : Array(Trie(K, V)), values : Values(K, V), bitmap : UInt64, levels : Int32, owner : UInt64 | Nil = nil)
#
Class Method Detail
Instance Method Detail
def each(&)
#
Description copied from module Enumerable({K, V})
Must yield this collection's elements to the block.
def empty?
#
Description copied from module Enumerable({K, V})
Returns true
if self
is empty, false
otherwise.
([] of Int32).empty? # => true
([1]).empty? # => false
def size
#
Description copied from module Enumerable({K, V})
Returns the number of elements in the collection.
[1, 2, 3, 4].size # => 4