abstract class Nanoarrow::ArrayBase(T)

Included Modules

Direct Known Subclasses

Defined in:

nanoarrow/array.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(ptr : Pointer(LibNanoarrowBridge::ArrowArray)) #

[View source]

Instance Method Detail

def [](index : Int) : T | Nil #

Returns the element at index, supporting negative indices.


[View source]
def [](range : Range) : Array(T | Nil) #

Returns the sub-array for the given Range, supporting negative indices.


[View source]
def compact : Array(T) #

Returns a new Array containing only non-null values.


[View source]
def each(& : T | Nil -> ) : Nil #

Yields each element (nil for null entries). Provides the full Enumerable API.


[View source]
def empty? : Bool #
Description copied from module Enumerable(T?)

Returns true if self does not contain any element.

([] of Int32).empty? # => true
([1]).empty?         # => false
[nil, false].empty?  # => false
  • #present? returns the inverse.

[View source]
def finalize #

[View source]
def inspect(io : IO) : Nil #
Description copied from class Reference

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>

[View source]
def length : Int64 #

[View source]
def null?(index : Int) : Bool #

[View source]
def null_count : Int64 #

[View source]
def ptr : Pointer(LibNanoarrowBridge::ArrowArray) #

[View source]
def release : Nil #

[View source]
def released? : Bool #

[View source]
def size : Int64 #
Description copied from module Enumerable(T?)

Returns the number of elements in the collection.

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

[View source]
def to_s(io : IO) : Nil #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def to_unsafe : Pointer(LibNanoarrowBridge::ArrowArray) #

[View source]
abstract def unsafe_get(index : Int64) : T | Nil #

Subclasses implement raw element access (index is already bounds-checked).


[View source]