class Immutable::Vector::Trie(T)
- Immutable::Vector::Trie(T)
- Reference
- Object
Included Modules
- Enumerable(T)
Defined in:
immutable/vector/trie.crConstant Summary
-
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)
- .new(values : Array(T), owner : UInt64 | Nil = nil)
Class Method Summary
Instance Method Summary
- #at(index : Int, &)
- #clear_owner!
-
#each(&)
Must yield this collection's elements to the block.
- #each
-
#empty?
Returns
true
ifself
is empty,false
otherwise. - #get(index : Int)
-
#inspect
Returns an unambiguous and information-rich string representation of this object, typically intended for developers.
- #last
- #last_leaf
- #leaf?
- #levels
- #pop_leaf(from : UInt64 | Nil = nil) : Trie(T)
- #pop_leaf!(from : UInt64) : Trie(T)
- #push_leaf(leaf : Array(T), from : UInt64 | Nil = nil) : Trie(T)
- #push_leaf!(leaf : Array(T), from : UInt64) : Trie(T)
-
#size
Returns the number of elements in the collection.
- #update(index : Int, value : T) : Trie(T)
- #update!(index : Int, value : T, from : UInt64) : Trie(T)
Constructor Detail
Class Method Detail
Instance Method Detail
def each(&)
#
Description copied from module Enumerable(T)
Must yield this collection's elements to the block.
def empty?
#
Description copied from module Enumerable(T)
Returns true
if self
is empty, false
otherwise.
([] of Int32).empty? # => true
([1]).empty? # => false
def inspect
#
Description copied from class Object
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
.
def size
#
Description copied from module Enumerable(T)
Returns the number of elements in the collection.
[1, 2, 3, 4].size # => 4