# automatically generated by the FlatBuffers compiler, do not modify

# namespace: aghast_generated

import flatbuffers

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

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

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

    # IrregularBinning
    def Intervals(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) * 24
            from .RealInterval import RealInterval
            obj = RealInterval()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

    # IrregularBinning
    def Overflow(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = o + self._tab.Pos
            from .RealOverflow import RealOverflow
            obj = RealOverflow()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def IrregularBinningStart(builder): builder.StartObject(3)
def IrregularBinningAddIntervals(builder, intervals): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(intervals), 0)
def IrregularBinningStartIntervalsVector(builder, numElems): return builder.StartVector(24, numElems, 8)
def IrregularBinningAddOverflow(builder, overflow): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(overflow), 0)
def IrregularBinningAddOverlappingFill(builder, overlappingFill): builder.PrependInt8Slot(2, overlappingFill, 0)
def IrregularBinningEnd(builder): return builder.EndObject()

# automatically generated by the FlatBuffers compiler, do not modify

# namespace: aghast_generated

import flatbuffers

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

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

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

    # IrregularBinning
    def Intervals(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) * 24
            from .RealInterval import RealInterval
            obj = RealInterval()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

    # IrregularBinning
    def Overflow(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = o + self._tab.Pos
            from .RealOverflow import RealOverflow
            obj = RealOverflow()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def IrregularBinningStart(builder): builder.StartObject(3)
def IrregularBinningAddIntervals(builder, intervals): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(intervals), 0)
def IrregularBinningStartIntervalsVector(builder, numElems): return builder.StartVector(24, numElems, 8)
def IrregularBinningAddOverflow(builder, overflow): builder.PrependStructSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(overflow), 0)
def IrregularBinningAddOverlappingFill(builder, overlappingFill): builder.PrependInt8Slot(2, overlappingFill, 0)
def IrregularBinningEnd(builder): return builder.EndObject()

# automatically generated by the FlatBuffers compiler, do not modify # namespace: aghast_generated # IrregularBinning # IrregularBinning # IrregularBinning # IrregularBinning # IrregularBinning