Class DateArrayBuilder<TUnderlying, TArray, TBuilder>
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
TUnderlyingTArrayTBuilder
- Inheritance
-
DelegatingArrayBuilder<TUnderlying, TArray, TBuilder>DateArrayBuilder<TUnderlying, TArray, TBuilder>
- Implements
-
IArrowArrayBuilder<DateTime, TArray, TBuilder>IArrowArrayBuilder<DateTimeOffset, TArray, TBuilder>IArrowArrayBuilder<TArray, TBuilder>IArrowArrayBuilder<TArray>
- 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
innerBuilderIArrowArrayBuilder<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
valueDateTimeDate 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
valueDateTimeOffsetDate 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
spanReadOnlySpan<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
spanReadOnlySpan<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
valuesIEnumerable<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
valuesIEnumerable<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
dateTimeDateTime
Returns
- TUnderlying
Convert(DateTimeOffset)
protected abstract TUnderlying Convert(DateTimeOffset dateTimeOffset)
Parameters
dateTimeOffsetDateTimeOffset
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
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
indexintIndex at which to set value.
valueDateTimeOffsetDate 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
Returns
- TBuilder
Returns the builder (for fluent-style composition).