Table of Contents

Class DateArrayBuilder<TUnderlying, TArray, TBuilder>

Namespace
Apache.Arrow
Assembly
Apache.Arrow.dll

The DateArrayBuilder<TUnderlying, TArray, TBuilder> class is an abstract array builder that can accept dates in the form of DateTime or DateTimeOffset and convert to some underlying date representation.

public abstract class DateArrayBuilder<TUnderlying, TArray, TBuilder> : DelegatingArrayBuilder<TUnderlying, TArray, TBuilder>, IArrowArrayBuilder<DateTime, TArray, TBuilder>, IArrowArrayBuilder<DateTimeOffset, TArray, TBuilder>, IArrowArrayBuilder<TArray, TBuilder>, IArrowArrayBuilder<TArray>, IArrowArrayBuilder where TArray : IArrowArray where TBuilder : class, IArrowArrayBuilder<TArray>

Type Parameters

TUnderlying
TArray
TBuilder
Inheritance
DelegatingArrayBuilder<TUnderlying, TArray, TBuilder>
DateArrayBuilder<TUnderlying, TArray, TBuilder>
Implements
IArrowArrayBuilder<DateTime, TArray, TBuilder>
IArrowArrayBuilder<TArray, TBuilder>
Derived
Inherited Members

Constructors

DateArrayBuilder(IArrowArrayBuilder<TUnderlying, TArray, IArrowArrayBuilder<TArray>>)

Construct a new instance of the DateArrayBuilder<TUnderlying, TArray, TBuilder> class.

protected DateArrayBuilder(IArrowArrayBuilder<TUnderlying, TArray, IArrowArrayBuilder<TArray>> innerBuilder)

Parameters

innerBuilder IArrowArrayBuilder<TUnderlying, TArray, IArrowArrayBuilder<TArray>>

Inner builder that will produce arrays of type TArray.

Methods

Append(DateTime)

Append a date in the form of a DateTime object to the array.

public TBuilder Append(DateTime value)

Parameters

value DateTime

Date to add.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

The value of Kind on the input does not have any effect on the behaviour of this method.

Append(DateTimeOffset)

Append a date from a DateTimeOffset object to the array.

public TBuilder Append(DateTimeOffset value)

Parameters

value DateTimeOffset

Date to add.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

Note that to convert the supplied value parameter to a date, it is first converted to UTC and the date then taken from the UTC date/time. Depending on the value of its Offset property, this may not necessarily be the same as the date obtained by calling its Date property.

Append(ReadOnlySpan<DateTimeOffset>)

Append a span of dates in the form of DateTimeOffset objects to the array.

public TBuilder Append(ReadOnlySpan<DateTimeOffset> span)

Parameters

span ReadOnlySpan<DateTimeOffset>

Span of dates to add.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

Note that to convert the DateTimeOffset objects in the span parameter to dates, they are first converted to UTC and the date then taken from the UTC date/times. Depending on the value of each Offset property, this may not necessarily be the same as the date obtained by calling the Date property.

Append(ReadOnlySpan<DateTime>)

Append a span of dates in the form of DateTime objects to the array.

public TBuilder Append(ReadOnlySpan<DateTime> span)

Parameters

span ReadOnlySpan<DateTime>

Span of dates to add.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

The value of Kind on any of the inputs does not have any effect on the behaviour of this method.

AppendNull()

Append a null date to the array.

public override TBuilder AppendNull()

Returns

TBuilder

Returns the builder (for fluent-style composition).

AppendRange(IEnumerable<DateTimeOffset>)

Append a collection of dates in the form of DateTimeOffset objects to the array.

public TBuilder AppendRange(IEnumerable<DateTimeOffset> values)

Parameters

values IEnumerable<DateTimeOffset>

Collection of dates to add.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

Note that to convert the DateTimeOffset objects in the values parameter to dates, they are first converted to UTC and the date then taken from the UTC date/times. Depending on the value of each Offset property, this may not necessarily be the same as the date obtained by calling the Date property.

AppendRange(IEnumerable<DateTime>)

Append a collection of dates in the form of DateTime objects to the array.

public TBuilder AppendRange(IEnumerable<DateTime> values)

Parameters

values IEnumerable<DateTime>

Collection of dates to add.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

The value of Kind on any of the inputs does not have any effect on the behaviour of this method.

Convert(DateTime)

protected abstract TUnderlying Convert(DateTime dateTime)

Parameters

dateTime DateTime

Returns

TUnderlying

Convert(DateTimeOffset)

protected abstract TUnderlying Convert(DateTimeOffset dateTimeOffset)

Parameters

dateTimeOffset DateTimeOffset

Returns

TUnderlying

Set(int, DateTime)

Set the value of a date in the form of a DateTime object at the specified index.

public TBuilder Set(int index, DateTime value)

Parameters

index int

Index at which to set value.

value DateTime

Date to set.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

The value of Kind on the input does not have any effect on the behaviour of this method.

Set(int, DateTimeOffset)

Set the value of a date in the form of a DateTimeOffset object at the specified index.

public TBuilder Set(int index, DateTimeOffset value)

Parameters

index int

Index at which to set value.

value DateTimeOffset

Date to set.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

Note that to convert the supplied value parameter to a date, it is first converted to UTC and the date then taken from the UTC date/time. Depending on the value of its Offset property, this may not necessarily be the same as the date obtained by calling its Date property.

Swap(int, int)

Swap the values of the dates at the specified indices.

public TBuilder Swap(int i, int j)

Parameters

i int

First index.

j int

Second index.

Returns

TBuilder

Returns the builder (for fluent-style composition).