public void ProducesExpectedArray() { var time32Type = new Time32Type(TimeUnit.Second); var array = new Time32Array.Builder(time32Type) .Append(1) .Build(); Assert.Equal(1, array.Length); var valueSeconds = array.GetSeconds(0); Assert.NotNull(valueSeconds); Assert.Equal(1, valueSeconds.Value); var valueMilliSeconds = array.GetMilliSeconds(0); Assert.NotNull(valueMilliSeconds); Assert.Equal(1_000, valueMilliSeconds.Value); time32Type = new Time32Type(TimeUnit.Millisecond); array = new Time32Array.Builder(time32Type) .Append(1_000) .Build(); Assert.Equal(1, array.Length); valueSeconds = array.GetSeconds(0); Assert.NotNull(valueSeconds); Assert.Equal(1, valueSeconds.Value); valueMilliSeconds = array.GetMilliSeconds(0); Assert.NotNull(valueMilliSeconds); Assert.Equal(1_000, valueMilliSeconds.Value); }
public void Visit(Time32Type actualType) { Assert.IsAssignableFrom <Time32Type>(_expectedType); var expectedType = (Time32Type)_expectedType; Assert.Equal(expectedType.Unit, actualType.Unit); }
public Time32Array( Time32Type type, ArrowBuffer valueBuffer, ArrowBuffer nullBitmapBuffer, int length, int nullCount, int offset) : this(new ArrayData(type, length, nullCount, offset, new[] { nullBitmapBuffer, valueBuffer })) { }
public void Visit(Time32Type actualType) { if (_expectedType is Time32Type expectedType && expectedType.Unit == actualType.Unit) { _dataTypeMatch = true; } }
public void Visit(Time32Type type) { var builder = new Time32Array.Builder(type).Reserve(Length); for (var i = 0; i < Length; i++) { builder.Append(i); } Array = builder.Build(); }
public void Visit(Time32Type type) { Result = FieldType.Build( Flatbuf.Type.Time, Flatbuf.Time.CreateTime(Builder, ToFlatBuffer(type.Unit))); }
/// <summary> /// Construct a new instance of the <see cref="Builder"/> class. /// </summary> public Builder(Time32Type type) : base() { DataType = type; }
public void Visit(Time32Type type) => GenerateArray <int, Time32Array>((v, n, c, nc, o) => new Time32Array(type, v, n, c, nc, o));
public void Visit(Time32Type type) { throw new NotImplementedException(); }
public Time32Array Time32(Time32Type type, Action <Time32Array.Builder> action) => Build <Time32Array, Time32Array.Builder>( new Time32Array.Builder(type), action);