Immutable::Vector::Trie(T)
Inherits Enumerable < Reference < Object
Constants
BITS_PER_LEVEL = 5_u32
BLOCK_SIZE = (2 ** BITS_PER_LEVEL).to_u32
INDEX_MASK = BLOCK_SIZE - 1
Constructors
new(children : Array(Trie(T)), levels : Int32, owner : UInt64 | Nil = nil)
Sourcenew(values : Array(T), owner : UInt64 | Nil = nil)
SourceClass methods
empty(owner : UInt64 | Nil = nil)
Sourcefrom(elems : Array(T), owner : UInt64)
Sourcefrom(elems : Array(T))
SourceInstance methods
at(index : Int, &)
Sourceclear_owner!
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.
get(index : Int)
Sourceinspect
Returns an unambiguous and information-rich string representation of this object, typically intended for developers.
This method should usually not be overridden. It delegates to
#inspect(IO) which can be overridden for custom implementations.
Also see #to_s.
last
Sourcelast_leaf
Sourceleaf?
Sourcelevels
Sourcepop_leaf(from : UInt64 | Nil = nil) : Trie(T)
Sourcepop_leaf!(from : UInt64) : Trie(T)
Sourcepush_leaf(leaf : Array(T), from : UInt64 | Nil = nil) : Trie(T)
Sourcepush_leaf!(leaf : Array(T), from : UInt64) : Trie(T)
Sourceupdate(index : Int, value : T) : Trie(T)
Sourceupdate!(index : Int, value : T, from : UInt64) : Trie(T)
Source