• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 import java.nio.*
4 import kotlin.math.sign
5 import com.google.flatbuffers.*
6 
7 @Suppress("unused")
8 class Movie : Table() {
9 
__initnull10     fun __init(_i: Int, _bb: ByteBuffer)  {
11         __reset(_i, _bb)
12     }
__assignnull13     fun __assign(_i: Int, _bb: ByteBuffer) : Movie {
14         __init(_i, _bb)
15         return this
16     }
17     val mainCharacterType : UByte
18         get() {
19             val o = __offset(4)
20             return if(o != 0) bb.get(o + bb_pos).toUByte() else 0u
21         }
mutateMainCharacterTypenull22     fun mutateMainCharacterType(mainCharacterType: UByte) : Boolean {
23         val o = __offset(4)
24         return if (o != 0) {
25             bb.put(o + bb_pos, mainCharacterType.toByte())
26             true
27         } else {
28             false
29         }
30     }
mainCharacternull31     fun mainCharacter(obj: Table) : Table? {
32         val o = __offset(6); return if (o != 0) __union(obj, o + bb_pos) else null
33     }
charactersTypenull34     fun charactersType(j: Int) : UByte {
35         val o = __offset(8)
36         return if (o != 0) {
37             bb.get(__vector(o) + j * 1).toUByte()
38         } else {
39             0u
40         }
41     }
42     val charactersTypeLength : Int
43         get() {
44             val o = __offset(8); return if (o != 0) __vector_len(o) else 0
45         }
46     val charactersTypeAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(8, 1)
charactersTypeInByteBuffernull47     fun charactersTypeInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 8, 1)
48     fun mutateCharactersType(j: Int, charactersType: UByte) : Boolean {
49         val o = __offset(8)
50         return if (o != 0) {
51             bb.put(__vector(o) + j * 1, charactersType.toByte())
52             true
53         } else {
54             false
55         }
56     }
charactersnull57     fun characters(obj: Table, j: Int) : Table? {
58         val o = __offset(10)
59         return if (o != 0) {
60             __union(obj, __vector(o) + j * 4)
61         } else {
62             null
63         }
64     }
65     val charactersLength : Int
66         get() {
67             val o = __offset(10); return if (o != 0) __vector_len(o) else 0
68         }
69     companion object {
validateVersionnull70         fun validateVersion() = Constants.FLATBUFFERS_2_0_0()
71         fun getRootAsMovie(_bb: ByteBuffer): Movie = getRootAsMovie(_bb, Movie())
72         fun getRootAsMovie(_bb: ByteBuffer, obj: Movie): Movie {
73             _bb.order(ByteOrder.LITTLE_ENDIAN)
74             return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb))
75         }
MovieBufferHasIdentifiernull76         fun MovieBufferHasIdentifier(_bb: ByteBuffer) : Boolean = __has_identifier(_bb, "MOVI")
77         fun createMovie(builder: FlatBufferBuilder, mainCharacterType: UByte, mainCharacterOffset: Int, charactersTypeOffset: Int, charactersOffset: Int) : Int {
78             builder.startTable(4)
79             addCharacters(builder, charactersOffset)
80             addCharactersType(builder, charactersTypeOffset)
81             addMainCharacter(builder, mainCharacterOffset)
82             addMainCharacterType(builder, mainCharacterType)
83             return endMovie(builder)
84         }
startMovienull85         fun startMovie(builder: FlatBufferBuilder) = builder.startTable(4)
86         fun addMainCharacterType(builder: FlatBufferBuilder, mainCharacterType: UByte) = builder.addByte(0, mainCharacterType.toByte(), 0)
87         fun addMainCharacter(builder: FlatBufferBuilder, mainCharacter: Int) = builder.addOffset(1, mainCharacter, 0)
88         fun addCharactersType(builder: FlatBufferBuilder, charactersType: Int) = builder.addOffset(2, charactersType, 0)
89         fun createCharactersTypeVector(builder: FlatBufferBuilder, data: UByteArray) : Int {
90             builder.startVector(1, data.size, 1)
91             for (i in data.size - 1 downTo 0) {
92                 builder.addByte(data[i].toByte())
93             }
94             return builder.endVector()
95         }
startCharactersTypeVectornull96         fun startCharactersTypeVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(1, numElems, 1)
97         fun addCharacters(builder: FlatBufferBuilder, characters: Int) = builder.addOffset(3, characters, 0)
98         fun createCharactersVector(builder: FlatBufferBuilder, data: IntArray) : Int {
99             builder.startVector(4, data.size, 4)
100             for (i in data.size - 1 downTo 0) {
101                 builder.addOffset(data[i])
102             }
103             return builder.endVector()
104         }
startCharactersVectornull105         fun startCharactersVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4)
106         fun endMovie(builder: FlatBufferBuilder) : Int {
107             val o = builder.endTable()
108             return o
109         }
finishMovieBuffernull110         fun finishMovieBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finish(offset, "MOVI")
111         fun finishSizePrefixedMovieBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finishSizePrefixed(offset, "MOVI")
112     }
113 }
114