# automatically generated by the FlatBuffers compiler, do not modify

# namespace: aghast_generated

import flatbuffers

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

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

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

    # VariationBinning
    def Variations(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Variation import Variation
            obj = Variation()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

    # VariationBinning
    def SystematicUnits(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

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

    # VariationBinning
    def SystematicNamesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

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

    # VariationBinning
    def CategorySystematicNamesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

def VariationBinningStart(builder): builder.StartObject(4)
def VariationBinningAddVariations(builder, variations): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(variations), 0)
def VariationBinningStartVariationsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def VariationBinningAddSystematicUnits(builder, systematicUnits): builder.PrependInt8Slot(1, systematicUnits, 0)
def VariationBinningAddSystematicNames(builder, systematicNames): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(systematicNames), 0)
def VariationBinningStartSystematicNamesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def VariationBinningAddCategorySystematicNames(builder, categorySystematicNames): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(categorySystematicNames), 0)
def VariationBinningStartCategorySystematicNamesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def VariationBinningEnd(builder): return builder.EndObject()
