// automatically generated by the FlatBuffers compiler, do not modify

package org.nd4j.graph;

import java.nio.*;
import java.lang.*;
import java.nio.ByteOrder;
import java.util.*;
import com.google.flatbuffers.*;

@SuppressWarnings("unused")
public final class UIHistogram extends Table {
  public static UIHistogram getRootAsUIHistogram(ByteBuffer _bb) { return getRootAsUIHistogram(_bb, new UIHistogram()); }
  public static UIHistogram getRootAsUIHistogram(ByteBuffer _bb, UIHistogram obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
  public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
  public UIHistogram __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public byte type() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public long numbins() { int o = __offset(6); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0L; }
  public FlatArray binranges() { return binranges(new FlatArray()); }
  public FlatArray binranges(FlatArray obj) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
  public FlatArray y() { return y(new FlatArray()); }
  public FlatArray y(FlatArray obj) { int o = __offset(10); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
  public String binlabels(int j) { int o = __offset(12); return o != 0 ? __string(__vector(o) + j * 4) : null; }
  public int binlabelsLength() { int o = __offset(12); return o != 0 ? __vector_len(o) : 0; }

  public static int createUIHistogram(FlatBufferBuilder builder,
      byte type,
      long numbins,
      int binrangesOffset,
      int yOffset,
      int binlabelsOffset) {
    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, byte type) { builder.addByte(0, type, 0); }
  public static void addNumbins(FlatBufferBuilder builder, long numbins) { builder.addInt(1, (int)numbins, (int)0L); }
  public static void addBinranges(FlatBufferBuilder builder, int binrangesOffset) { builder.addOffset(2, binrangesOffset, 0); }
  public static void addY(FlatBufferBuilder builder, int yOffset) { builder.addOffset(3, yOffset, 0); }
  public static void addBinlabels(FlatBufferBuilder builder, int binlabelsOffset) { builder.addOffset(4, binlabelsOffset, 0); }
  public static int createBinlabelsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
  public static void startBinlabelsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static int endUIHistogram(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}

