Ejemplo n.º 1
0
            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);
            }
Ejemplo n.º 2
0
            public void Visit(Time64Type actualType)
            {
                Assert.IsAssignableFrom <Time64Type>(_expectedType);
                var expectedType = (Time64Type)_expectedType;

                Assert.Equal(expectedType.Unit, actualType.Unit);
            }
Ejemplo n.º 3
0
 public void Visit(Time64Type actualType)
 {
     if (_expectedType is Time64Type expectedType &&
         expectedType.Unit == actualType.Unit)
     {
         _dataTypeMatch = true;
     }
 }
Ejemplo n.º 4
0
 public Time64Array(
     Time64Type type,
     ArrowBuffer valueBuffer, ArrowBuffer nullBitmapBuffer,
     int length, int nullCount, int offset)
     : this(new ArrayData(type, length, nullCount, offset,
                          new[] { nullBitmapBuffer, valueBuffer }))
 {
 }
Ejemplo n.º 5
0
            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));
 }
Ejemplo n.º 7
0
 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));
Ejemplo n.º 8
0
 public void Visit(Time64Type type)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 9
0
 public Time64Array Time64(Time64Type type, Action <Time64Array.Builder> action) =>
 Build <Time64Array, Time64Array.Builder>(
     new Time64Array.Builder(type), action);
Ejemplo n.º 10
0
 /// <summary>
 /// Construct a new instance of the <see cref="Builder"/> class.
 /// </summary>
 public Builder(Time64Type type)
     : base()
 {
     DataType = type;
 }