// <auto-generated>
//  automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>

namespace nd4j.graph
{

using global::System;
using global::FlatBuffers;

public struct FlatArrayList : IFlatbufferObject
{
  private Table __p;
  public ByteBuffer ByteBuffer { get { return __p.bb; } }
  public static FlatArrayList GetRootAsFlatArrayList(ByteBuffer _bb) { return GetRootAsFlatArrayList(_bb, new FlatArrayList()); }
  public static FlatArrayList GetRootAsFlatArrayList(ByteBuffer _bb, FlatArrayList obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
  public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
  public FlatArrayList __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public FlatArray? List(int j) { int o = __p.__offset(4); return o != 0 ? (FlatArray?)(new FlatArray()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
  public int ListLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }

  public static Offset<FlatArrayList> CreateFlatArrayList(FlatBufferBuilder builder,
      VectorOffset listOffset = default(VectorOffset)) {
    builder.StartObject(1);
    FlatArrayList.AddList(builder, listOffset);
    return FlatArrayList.EndFlatArrayList(builder);
  }

  public static void StartFlatArrayList(FlatBufferBuilder builder) { builder.StartObject(1); }
  public static void AddList(FlatBufferBuilder builder, VectorOffset listOffset) { builder.AddOffset(0, listOffset.Value, 0); }
  public static VectorOffset CreateListVector(FlatBufferBuilder builder, Offset<FlatArray>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
  public static VectorOffset CreateListVectorBlock(FlatBufferBuilder builder, Offset<FlatArray>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
  public static void StartListVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
  public static Offset<FlatArrayList> EndFlatArrayList(FlatBufferBuilder builder) {
    int o = builder.EndObject();
    return new Offset<FlatArrayList>(o);
  }
};


}
