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

package com.github.davidmoten.rtree.fbs.generated;

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

@SuppressWarnings("unused")
public final class Node_ extends Table {
  public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_8(); }
  public static Node_ getRootAsNode_(ByteBuffer _bb) { return getRootAsNode_(_bb, new Node_()); }
  public static Node_ getRootAsNode_(ByteBuffer _bb, Node_ obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
  public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
  public Node_ __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public com.github.davidmoten.rtree.fbs.generated.Bounds_ mbb() { return mbb(new com.github.davidmoten.rtree.fbs.generated.Bounds_()); }
  public com.github.davidmoten.rtree.fbs.generated.Bounds_ mbb(com.github.davidmoten.rtree.fbs.generated.Bounds_ obj) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
  public com.github.davidmoten.rtree.fbs.generated.Node_ children(int j) { return children(new com.github.davidmoten.rtree.fbs.generated.Node_(), j); }
  public com.github.davidmoten.rtree.fbs.generated.Node_ children(com.github.davidmoten.rtree.fbs.generated.Node_ obj, int j) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
  public int childrenLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
  public com.github.davidmoten.rtree.fbs.generated.Node_.Vector childrenVector() { return childrenVector(new com.github.davidmoten.rtree.fbs.generated.Node_.Vector()); }
  public com.github.davidmoten.rtree.fbs.generated.Node_.Vector childrenVector(com.github.davidmoten.rtree.fbs.generated.Node_.Vector obj) { int o = __offset(6); return o != 0 ? obj.__assign(__vector(o), 4, bb) : null; }
  public com.github.davidmoten.rtree.fbs.generated.Entry_ entries(int j) { return entries(new com.github.davidmoten.rtree.fbs.generated.Entry_(), j); }
  public com.github.davidmoten.rtree.fbs.generated.Entry_ entries(com.github.davidmoten.rtree.fbs.generated.Entry_ obj, int j) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
  public int entriesLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }
  public com.github.davidmoten.rtree.fbs.generated.Entry_.Vector entriesVector() { return entriesVector(new com.github.davidmoten.rtree.fbs.generated.Entry_.Vector()); }
  public com.github.davidmoten.rtree.fbs.generated.Entry_.Vector entriesVector(com.github.davidmoten.rtree.fbs.generated.Entry_.Vector obj) { int o = __offset(8); return o != 0 ? obj.__assign(__vector(o), 4, bb) : null; }

  public static int createNode_(FlatBufferBuilder builder,
      int mbbOffset,
      int childrenOffset,
      int entriesOffset) {
    builder.startTable(3);
    Node_.addEntries(builder, entriesOffset);
    Node_.addChildren(builder, childrenOffset);
    Node_.addMbb(builder, mbbOffset);
    return Node_.endNode_(builder);
  }

  public static void startNode_(FlatBufferBuilder builder) { builder.startTable(3); }
  public static void addMbb(FlatBufferBuilder builder, int mbbOffset) { builder.addOffset(0, mbbOffset, 0); }
  public static void addChildren(FlatBufferBuilder builder, int childrenOffset) { builder.addOffset(1, childrenOffset, 0); }
  public static int createChildrenVector(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 startChildrenVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static void addEntries(FlatBufferBuilder builder, int entriesOffset) { builder.addOffset(2, entriesOffset, 0); }
  public static int createEntriesVector(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 startEntriesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static int endNode_(FlatBufferBuilder builder) {
    int o = builder.endTable();
    return o;
  }

  public static final class Vector extends BaseVector {
    public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }

    public Node_ get(int j) { return get(new Node_(), j); }
    public Node_ get(Node_ obj, int j) {  return obj.__assign(__indirect(__element(j), bb), bb); }
  }
}

