class
Myhtml::Iterator::Collection
- Myhtml::Iterator::Collection
- Reference
- Object
Included Modules
- Indexable(Myhtml::Node)
- Myhtml::Iterator::Filter
Defined in:
myhtml/iterator/collection.crConstructors
Instance Method Summary
- #finalize
- #free
- #inspect(io)
-
#size : UInt64
Returns the number of elements in this container.
-
#unsafe_fetch(index : Int)
Returns the element at the given index, without doing any bounds check.
Instance methods inherited from module Myhtml::Iterator::Filter
nodes(tag_id : Lib::MyhtmlTags)nodes(tag_sym : Symbol)
nodes(tag_str : String) nodes
Constructor Detail
def self.new(tree : Myhtml::Tree, raw_collection : Pointer(Myhtml::Lib::MyhtmlCollectionT))
#
Instance Method Detail
def size : UInt64
#
Description copied from module Indexable(Myhtml::Node)
Returns the number of elements in this container.
def unsafe_fetch(index : Int)
#
Description copied from module Indexable(Myhtml::Node)
Returns the element at the given index, without doing any bounds check.
Indexable
makes sure to invoke this method with index in 0...size
,
so converting negative indices to positive ones is not needed here.
Clients never invoke this method directly. Instead, they access
elements with #[](index)
and #[]?(index)
.
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.