Immutable::Map::Trie(K, V)
Inherits Enumerable < Reference < Object
Constants
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
new(children : Array(Trie(K, V)), values : Values(K, V), bitmap : UInt64, levels : Int32, owner : UInt64 | Nil = nil)
SourceClass methods
empty(owner : UInt64 | Nil = nil)
SourceInstance methods
clear_owner!
Sourcedelete(key : K) : Trie(K, V)
Sourcedelete!(key : K, from : UInt64) : Trie(K, V)
Sourceeach
Sourceempty?
Returns true if self does not contain any element.
([] of Int32).empty? # => true
([1]).empty? # => false
[nil, false].empty? # => false
#present?returns the inverse.
fetch(key : K, &block : K -> _)
Sourcefind_entry(key : K) : Entry(K, V) | Nil
Sourceget(key : K) : V
Sourcehas_key?(key : K) : Bool
Sourcelevels
Sourceset(key : K, value : V) : Trie(K, V)
Sourceset!(key : K, value : V, from : UInt64) : Trie(K, V)
Source