1 // automatically generated by the FlatBuffers compiler, do not modify 2 3 package DictionaryLookup 4 5 import com.google.flatbuffers.BaseVector 6 import com.google.flatbuffers.BooleanVector 7 import com.google.flatbuffers.ByteVector 8 import com.google.flatbuffers.Constants 9 import com.google.flatbuffers.DoubleVector 10 import com.google.flatbuffers.FlatBufferBuilder 11 import com.google.flatbuffers.FloatVector 12 import com.google.flatbuffers.LongVector 13 import com.google.flatbuffers.StringVector 14 import com.google.flatbuffers.Struct 15 import com.google.flatbuffers.Table 16 import com.google.flatbuffers.UnionVector 17 import java.nio.ByteBuffer 18 import java.nio.ByteOrder 19 import kotlin.math.sign 20 21 @Suppress("unused") 22 class LongFloatMap : Table() { 23 __initnull24 fun __init(_i: Int, _bb: ByteBuffer) { 25 __reset(_i, _bb) 26 } __assignnull27 fun __assign(_i: Int, _bb: ByteBuffer) : LongFloatMap { 28 __init(_i, _bb) 29 return this 30 } entriesnull31 fun entries(j: Int) : DictionaryLookup.LongFloatEntry? = entries(DictionaryLookup.LongFloatEntry(), j) 32 fun entries(obj: DictionaryLookup.LongFloatEntry, j: Int) : DictionaryLookup.LongFloatEntry? { 33 val o = __offset(4) 34 return if (o != 0) { 35 obj.__assign(__indirect(__vector(o) + j * 4), bb) 36 } else { 37 null 38 } 39 } 40 val entriesLength : Int 41 get() { 42 val o = __offset(4); return if (o != 0) __vector_len(o) else 0 43 } entriesByKeynull44 fun entriesByKey(key: Long) : DictionaryLookup.LongFloatEntry? { 45 val o = __offset(4) 46 return if (o != 0) { 47 DictionaryLookup.LongFloatEntry.__lookup_by_key(null, __vector(o), key, bb) 48 } else { 49 null 50 } 51 } entriesByKeynull52 fun entriesByKey(obj: DictionaryLookup.LongFloatEntry, key: Long) : DictionaryLookup.LongFloatEntry? { 53 val o = __offset(4) 54 return if (o != 0) { 55 DictionaryLookup.LongFloatEntry.__lookup_by_key(obj, __vector(o), key, bb) 56 } else { 57 null 58 } 59 } 60 companion object { validateVersionnull61 fun validateVersion() = Constants.FLATBUFFERS_24_3_25() 62 fun getRootAsLongFloatMap(_bb: ByteBuffer): LongFloatMap = getRootAsLongFloatMap(_bb, LongFloatMap()) 63 fun getRootAsLongFloatMap(_bb: ByteBuffer, obj: LongFloatMap): LongFloatMap { 64 _bb.order(ByteOrder.LITTLE_ENDIAN) 65 return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)) 66 } createLongFloatMapnull67 fun createLongFloatMap(builder: FlatBufferBuilder, entriesOffset: Int) : Int { 68 builder.startTable(1) 69 addEntries(builder, entriesOffset) 70 return endLongFloatMap(builder) 71 } startLongFloatMapnull72 fun startLongFloatMap(builder: FlatBufferBuilder) = builder.startTable(1) 73 fun addEntries(builder: FlatBufferBuilder, entries: Int) = builder.addOffset(0, entries, 0) 74 fun createEntriesVector(builder: FlatBufferBuilder, data: IntArray) : Int { 75 builder.startVector(4, data.size, 4) 76 for (i in data.size - 1 downTo 0) { 77 builder.addOffset(data[i]) 78 } 79 return builder.endVector() 80 } startEntriesVectornull81 fun startEntriesVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4) 82 fun endLongFloatMap(builder: FlatBufferBuilder) : Int { 83 val o = builder.endTable() 84 return o 85 } finishLongFloatMapBuffernull86 fun finishLongFloatMapBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finish(offset) 87 fun finishSizePrefixedLongFloatMapBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finishSizePrefixed(offset) 88 } 89 } 90