xref: /aosp_15_r20/external/flatbuffers/tests/DictionaryLookup/LongFloatMap.kt (revision 890232f25432b36107d06881e0a25aaa6b473652)
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 package DictionaryLookup
4 
5 import java.nio.*
6 import kotlin.math.sign
7 import com.google.flatbuffers.*
8 
9 @Suppress("unused")
10 class LongFloatMap : Table() {
11 
__initnull12     fun __init(_i: Int, _bb: ByteBuffer)  {
13         __reset(_i, _bb)
14     }
__assignnull15     fun __assign(_i: Int, _bb: ByteBuffer) : LongFloatMap {
16         __init(_i, _bb)
17         return this
18     }
entriesnull19     fun entries(j: Int) : DictionaryLookup.LongFloatEntry? = entries(DictionaryLookup.LongFloatEntry(), j)
20     fun entries(obj: DictionaryLookup.LongFloatEntry, j: Int) : DictionaryLookup.LongFloatEntry? {
21         val o = __offset(4)
22         return if (o != 0) {
23             obj.__assign(__indirect(__vector(o) + j * 4), bb)
24         } else {
25             null
26         }
27     }
28     val entriesLength : Int
29         get() {
30             val o = __offset(4); return if (o != 0) __vector_len(o) else 0
31         }
entriesByKeynull32     fun entriesByKey(key: Long) : DictionaryLookup.LongFloatEntry? {
33         val o = __offset(4)
34         return if (o != 0) {
35             DictionaryLookup.LongFloatEntry.__lookup_by_key(null, __vector(o), key, bb)
36         } else {
37             null
38         }
39     }
entriesByKeynull40     fun entriesByKey(obj: DictionaryLookup.LongFloatEntry, key: Long) : DictionaryLookup.LongFloatEntry? {
41         val o = __offset(4)
42         return if (o != 0) {
43             DictionaryLookup.LongFloatEntry.__lookup_by_key(obj, __vector(o), key, bb)
44         } else {
45             null
46         }
47     }
48     companion object {
validateVersionnull49         fun validateVersion() = Constants.FLATBUFFERS_2_0_0()
50         fun getRootAsLongFloatMap(_bb: ByteBuffer): LongFloatMap = getRootAsLongFloatMap(_bb, LongFloatMap())
51         fun getRootAsLongFloatMap(_bb: ByteBuffer, obj: LongFloatMap): LongFloatMap {
52             _bb.order(ByteOrder.LITTLE_ENDIAN)
53             return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
54         }
createLongFloatMapnull55         fun createLongFloatMap(builder: FlatBufferBuilder, entriesOffset: Int) : Int {
56             builder.startTable(1)
57             addEntries(builder, entriesOffset)
58             return endLongFloatMap(builder)
59         }
startLongFloatMapnull60         fun startLongFloatMap(builder: FlatBufferBuilder) = builder.startTable(1)
61         fun addEntries(builder: FlatBufferBuilder, entries: Int) = builder.addOffset(0, entries, 0)
62         fun createEntriesVector(builder: FlatBufferBuilder, data: IntArray) : Int {
63             builder.startVector(4, data.size, 4)
64             for (i in data.size - 1 downTo 0) {
65                 builder.addOffset(data[i])
66             }
67             return builder.endVector()
68         }
startEntriesVectornull69         fun startEntriesVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4)
70         fun endLongFloatMap(builder: FlatBufferBuilder) : Int {
71             val o = builder.endTable()
72             return o
73         }
finishLongFloatMapBuffernull74         fun finishLongFloatMapBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finish(offset)
75         fun finishSizePrefixedLongFloatMapBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finishSizePrefixed(offset)
76     }
77 }
78