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

namespace nd4j.graph
{

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

public struct UIHistogram : IFlatbufferObject
{
  private Table __p;
  public ByteBuffer ByteBuffer { get { return __p.bb; } }
  public static UIHistogram GetRootAsUIHistogram(ByteBuffer _bb) { return GetRootAsUIHistogram(_bb, new UIHistogram()); }
  public static UIHistogram GetRootAsUIHistogram(ByteBuffer _bb, UIHistogram 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 UIHistogram __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public UIHistogramType Type { get { int o = __p.__offset(4); return o != 0 ? (UIHistogramType)__p.bb.GetSbyte(o + __p.bb_pos) : UIHistogramType.DISCRETE; } }
  public uint Numbins { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
  public FlatArray? Binranges { get { int o = __p.__offset(8); return o != 0 ? (FlatArray?)(new FlatArray()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
  public FlatArray? Y { get { int o = __p.__offset(10); return o != 0 ? (FlatArray?)(new FlatArray()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } }
  public string Binlabels(int j) { int o = __p.__offset(12); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
  public int BinlabelsLength { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } }

  public static Offset<UIHistogram> CreateUIHistogram(FlatBufferBuilder builder,
      UIHistogramType type = UIHistogramType.DISCRETE,
      uint numbins = 0,
      Offset<FlatArray> binrangesOffset = default(Offset<FlatArray>),
      Offset<FlatArray> yOffset = default(Offset<FlatArray>),
      VectorOffset binlabelsOffset = default(VectorOffset)) {
    builder.StartObject(5);
    UIHistogram.AddBinlabels(builder, binlabelsOffset);
    UIHistogram.AddY(builder, yOffset);
    UIHistogram.AddBinranges(builder, binrangesOffset);
    UIHistogram.AddNumbins(builder, numbins);
    UIHistogram.AddType(builder, type);
    return UIHistogram.EndUIHistogram(builder);
  }

  public static void StartUIHistogram(FlatBufferBuilder builder) { builder.StartObject(5); }
  public static void AddType(FlatBufferBuilder builder, UIHistogramType type) { builder.AddSbyte(0, (sbyte)type, 0); }
  public static void AddNumbins(FlatBufferBuilder builder, uint numbins) { builder.AddUint(1, numbins, 0); }
  public static void AddBinranges(FlatBufferBuilder builder, Offset<FlatArray> binrangesOffset) { builder.AddOffset(2, binrangesOffset.Value, 0); }
  public static void AddY(FlatBufferBuilder builder, Offset<FlatArray> yOffset) { builder.AddOffset(3, yOffset.Value, 0); }
  public static void AddBinlabels(FlatBufferBuilder builder, VectorOffset binlabelsOffset) { builder.AddOffset(4, binlabelsOffset.Value, 0); }
  public static VectorOffset CreateBinlabelsVector(FlatBufferBuilder builder, StringOffset[] 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 CreateBinlabelsVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
  public static void StartBinlabelsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
  public static Offset<UIHistogram> EndUIHistogram(FlatBufferBuilder builder) {
    int o = builder.EndObject();
    return new Offset<UIHistogram>(o);
  }
};


}
