class Immutable::Map::Trie(K, V)

Included Modules

Defined in:

immutable/map/trie.cr

Constant 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

Constructor Detail

def self.new(children : Array(Trie(K, V)), values : Values(K, V), bitmap : UInt64, levels : Int32, owner : UInt64 | Nil = nil) #

[View source]

Class Method Detail

def self.empty(owner : UInt64 | Nil = nil) #

[View source]

Instance Method Detail

def clear_owner! #

[View source]
def delete(key : K) : Trie(K, V) #

[View source]
def delete!(key : K, from : UInt64) : Trie(K, V) #

[View source]
def each(&) #
Description copied from module Enumerable({K, V})

Must yield this collection's elements to the block.


[View source]
def each #

[View source]
def empty? #
Description copied from module Enumerable({K, V})

Returns true if self is empty, false otherwise.

([] of Int32).empty? # => true
([1]).empty?         # => false

[View source]
def fetch(key : K, &block : K -> _) #

[View source]
def find_entry(key : K) : Entry(K, V) | Nil #

[View source]
def get(key : K) : V #

[View source]
def has_key?(key : K) : Bool #

[View source]
def levels #

[View source]
def set(key : K, value : V) : Trie(K, V) #

[View source]
def set!(key : K, value : V, from : UInt64) : Trie(K, V) #

[View source]
def size #
Description copied from module Enumerable({K, V})

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4

[View source]