# automatically generated by the FlatBuffers compiler, do not modify

# namespace: dataprotocol

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

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

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

    @classmethod
    def GetRootAsColumnValues(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # ColumnValues
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # ColumnValues
    def IsNullvalues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.BoolFlags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # ColumnValues
    def IsNullvaluesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.BoolFlags, o)
        return 0

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

    # ColumnValues
    def IsNullvaluesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # ColumnValues
    def LongValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # ColumnValues
    def LongValuesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # ColumnValues
    def LongValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # ColumnValues
    def LongValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # ColumnValues
    def BoolValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.BoolFlags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # ColumnValues
    def BoolValuesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.BoolFlags, o)
        return 0

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

    # ColumnValues
    def BoolValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # ColumnValues
    def DoubleValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # ColumnValues
    def DoubleValuesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o)
        return 0

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

    # ColumnValues
    def DoubleValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

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

    # ColumnValues
    def StringValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # ColumnValues
    def StringValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

    # ColumnValues
    def BinaryValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from tablestore.flatbuffer.dataprotocol.BytesValue import BytesValue
            obj = BytesValue()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # ColumnValues
    def BinaryValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # ColumnValues
    def BinaryValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        return o == 0

    # ColumnValues
    def RleStringValues(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from tablestore.flatbuffer.dataprotocol.RLEStringValues import RLEStringValues
            obj = RLEStringValues()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def ColumnValuesStart(builder): builder.StartObject(7)
def Start(builder):
    return ColumnValuesStart(builder)
def ColumnValuesAddIsNullvalues(builder, isNullvalues): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(isNullvalues), 0)
def AddIsNullvalues(builder, isNullvalues):
    return ColumnValuesAddIsNullvalues(builder, isNullvalues)
def ColumnValuesStartIsNullvaluesVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def StartIsNullvaluesVector(builder, numElems):
    return ColumnValuesStartIsNullvaluesVector(builder, numElems)
def ColumnValuesAddLongValues(builder, longValues): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(longValues), 0)
def AddLongValues(builder, longValues):
    return ColumnValuesAddLongValues(builder, longValues)
def ColumnValuesStartLongValuesVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartLongValuesVector(builder, numElems):
    return ColumnValuesStartLongValuesVector(builder, numElems)
def ColumnValuesAddBoolValues(builder, boolValues): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(boolValues), 0)
def AddBoolValues(builder, boolValues):
    return ColumnValuesAddBoolValues(builder, boolValues)
def ColumnValuesStartBoolValuesVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def StartBoolValuesVector(builder, numElems):
    return ColumnValuesStartBoolValuesVector(builder, numElems)
def ColumnValuesAddDoubleValues(builder, doubleValues): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(doubleValues), 0)
def AddDoubleValues(builder, doubleValues):
    return ColumnValuesAddDoubleValues(builder, doubleValues)
def ColumnValuesStartDoubleValuesVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartDoubleValuesVector(builder, numElems):
    return ColumnValuesStartDoubleValuesVector(builder, numElems)
def ColumnValuesAddStringValues(builder, stringValues): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(stringValues), 0)
def AddStringValues(builder, stringValues):
    return ColumnValuesAddStringValues(builder, stringValues)
def ColumnValuesStartStringValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartStringValuesVector(builder, numElems):
    return ColumnValuesStartStringValuesVector(builder, numElems)
def ColumnValuesAddBinaryValues(builder, binaryValues): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(binaryValues), 0)
def AddBinaryValues(builder, binaryValues):
    return ColumnValuesAddBinaryValues(builder, binaryValues)
def ColumnValuesStartBinaryValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartBinaryValuesVector(builder, numElems):
    return ColumnValuesStartBinaryValuesVector(builder, numElems)
def ColumnValuesAddRleStringValues(builder, rleStringValues): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(rleStringValues), 0)
def AddRleStringValues(builder, rleStringValues):
    return ColumnValuesAddRleStringValues(builder, rleStringValues)
def ColumnValuesEnd(builder): return builder.EndObject()
def End(builder):
    return ColumnValuesEnd(builder)