# automatically generated by the FlatBuffers compiler, do not modify

# namespace: feather_v1_fbs

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

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

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

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

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

    # PrimitiveArray
    def Encoding(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

    # Relative memory offset of the start of the array data excluding the size
    # of the metadata
    # PrimitiveArray
    def Offset(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # The number of logical values in the array
    # PrimitiveArray
    def Length(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # The number of observed nulls
    # PrimitiveArray
    def NullCount(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # The total size of the actual data in the file
    # PrimitiveArray
    def TotalBytes(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

def Start(builder): builder.StartObject(6)
def PrimitiveArrayStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddType(builder, type): builder.PrependInt8Slot(0, type, 0)
def PrimitiveArrayAddType(builder, type):
    """This method is deprecated. Please switch to AddType."""
    return AddType(builder, type)
def AddEncoding(builder, encoding): builder.PrependInt8Slot(1, encoding, 0)
def PrimitiveArrayAddEncoding(builder, encoding):
    """This method is deprecated. Please switch to AddEncoding."""
    return AddEncoding(builder, encoding)
def AddOffset(builder, offset): builder.PrependInt64Slot(2, offset, 0)
def PrimitiveArrayAddOffset(builder, offset):
    """This method is deprecated. Please switch to AddOffset."""
    return AddOffset(builder, offset)
def AddLength(builder, length): builder.PrependInt64Slot(3, length, 0)
def PrimitiveArrayAddLength(builder, length):
    """This method is deprecated. Please switch to AddLength."""
    return AddLength(builder, length)
def AddNullCount(builder, nullCount): builder.PrependInt64Slot(4, nullCount, 0)
def PrimitiveArrayAddNullCount(builder, nullCount):
    """This method is deprecated. Please switch to AddNullCount."""
    return AddNullCount(builder, nullCount)
def AddTotalBytes(builder, totalBytes): builder.PrependInt64Slot(5, totalBytes, 0)
def PrimitiveArrayAddTotalBytes(builder, totalBytes):
    """This method is deprecated. Please switch to AddTotalBytes."""
    return AddTotalBytes(builder, totalBytes)
def End(builder): return builder.EndObject()
def PrimitiveArrayEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)