# automatically generated by the FlatBuffers compiler, do not modify

# namespace: aghast_generated

import flatbuffers

class CategoryBinning(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsCategoryBinning(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = CategoryBinning()
        x.Init(buf, n + offset)
        return x

    # CategoryBinning
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # CategoryBinning
    def Categories(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

    # CategoryBinning
    def CategoriesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # CategoryBinning
    def LocOverflow(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

def CategoryBinningStart(builder): builder.StartObject(2)
def CategoryBinningAddCategories(builder, categories): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(categories), 0)
def CategoryBinningStartCategoriesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def CategoryBinningAddLocOverflow(builder, locOverflow): builder.PrependInt8Slot(1, locOverflow, 0)
def CategoryBinningEnd(builder): return builder.EndObject()
