public void ProducesExpectedArray() { var time64Type = new Time64Type(TimeUnit.Microsecond); var array = new Time64Array.Builder(time64Type) .Append(1_000_000) .Build(); Assert.Equal(1, array.Length); var valueMicroSeconds = array.GetMicroSeconds(0); Assert.NotNull(valueMicroSeconds); Assert.Equal(1_000_000, valueMicroSeconds.Value); var valueNanoSeconds = array.GetNanoSeconds(0); Assert.NotNull(valueNanoSeconds); Assert.Equal(1_000_000_000, valueNanoSeconds.Value); time64Type = new Time64Type(TimeUnit.Nanosecond); array = new Time64Array.Builder(time64Type) .Append(1_000_000_000) .Build(); Assert.Equal(1, array.Length); valueMicroSeconds = array.GetMicroSeconds(0); Assert.NotNull(valueMicroSeconds); Assert.Equal(1_000_000, valueMicroSeconds.Value); valueNanoSeconds = array.GetNanoSeconds(0); Assert.NotNull(valueNanoSeconds); Assert.Equal(1_000_000_000, valueNanoSeconds.Value); }
public void Visit(Time64Type actualType) { Assert.IsAssignableFrom <Time64Type>(_expectedType); var expectedType = (Time64Type)_expectedType; Assert.Equal(expectedType.Unit, actualType.Unit); }
public void Visit(Time64Type actualType) { if (_expectedType is Time64Type expectedType && expectedType.Unit == actualType.Unit) { _dataTypeMatch = true; } }
public Time64Array( Time64Type type, ArrowBuffer valueBuffer, ArrowBuffer nullBitmapBuffer, int length, int nullCount, int offset) : this(new ArrayData(type, length, nullCount, offset, new[] { nullBitmapBuffer, valueBuffer })) { }
public void Visit(Time64Type type) { var builder = new Time64Array.Builder(type).Reserve(Length); for (var i = 0; i < Length; i++) { builder.Append(i); } Array = builder.Build(); }
public void Visit(Time64Type type) { Result = FieldType.Build( Flatbuf.Type.Time, Flatbuf.Time.CreateTime(Builder, ToFlatBuffer(type.Unit), 64)); }
public void Visit(Time64Type type) => GenerateLongArray <long, Time64Array>((v, n, c, nc, o) => new Time64Array(type, v, n, c, nc, o), s => long.Parse(s));
public void Visit(Time64Type type) { throw new NotImplementedException(); }
public Time64Array Time64(Time64Type type, Action <Time64Array.Builder> action) => Build <Time64Array, Time64Array.Builder>( new Time64Array.Builder(type), action);
/// <summary> /// Construct a new instance of the <see cref="Builder"/> class. /// </summary> public Builder(Time64Type type) : base() { DataType = type; }