1 // automatically generated by the FlatBuffers compiler, do not modify 2 3 package MyGame.Example; 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.IntVector; 13 import com.google.flatbuffers.LongVector; 14 import com.google.flatbuffers.ShortVector; 15 import com.google.flatbuffers.StringVector; 16 import com.google.flatbuffers.Struct; 17 import com.google.flatbuffers.Table; 18 import com.google.flatbuffers.UnionVector; 19 import java.nio.ByteBuffer; 20 import java.nio.ByteOrder; 21 22 @SuppressWarnings("unused") 23 public final class NestedStruct extends Struct { __init(int _i, ByteBuffer _bb)24 public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } __assign(int _i, ByteBuffer _bb)25 public NestedStruct __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } 26 a(int j)27 public int a(int j) { return bb.getInt(bb_pos + 0 + j * 4); } mutateA(int j, int a)28 public void mutateA(int j, int a) { bb.putInt(bb_pos + 0 + j * 4, a); } b()29 public byte b() { return bb.get(bb_pos + 8); } mutateB(byte b)30 public void mutateB(byte b) { bb.put(bb_pos + 8, b); } c(int j)31 public byte c(int j) { return bb.get(bb_pos + 9 + j * 1); } mutateC(int j, byte c)32 public void mutateC(int j, byte c) { bb.put(bb_pos + 9 + j * 1, c); } d(int j)33 public long d(int j) { return bb.getLong(bb_pos + 16 + j * 8); } mutateD(int j, long d)34 public void mutateD(int j, long d) { bb.putLong(bb_pos + 16 + j * 8, d); } 35 createNestedStruct(FlatBufferBuilder builder, int[] a, byte b, byte[] c, long[] d)36 public static int createNestedStruct(FlatBufferBuilder builder, int[] a, byte b, byte[] c, long[] d) { 37 builder.prep(8, 32); 38 for (int _idx0 = 2; _idx0 > 0; _idx0--) { 39 builder.putLong(d[_idx0-1]); 40 } 41 builder.pad(5); 42 for (int _idx0 = 2; _idx0 > 0; _idx0--) { 43 builder.putByte(c[_idx0-1]); 44 } 45 builder.putByte(b); 46 for (int _idx0 = 2; _idx0 > 0; _idx0--) { 47 builder.putInt(a[_idx0-1]); 48 } 49 return builder.offset(); 50 } 51 52 public static final class Vector extends BaseVector { __assign(int _vector, int _element_size, ByteBuffer _bb)53 public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; } 54 get(int j)55 public NestedStruct get(int j) { return get(new NestedStruct(), j); } get(NestedStruct obj, int j)56 public NestedStruct get(NestedStruct obj, int j) { return obj.__assign(__element(j), bb); } 57 } unpack()58 public NestedStructT unpack() { 59 NestedStructT _o = new NestedStructT(); 60 unpackTo(_o); 61 return _o; 62 } unpackTo(NestedStructT _o)63 public void unpackTo(NestedStructT _o) { 64 int[] _oA = _o.getA(); 65 for (int _j = 0; _j < 2; ++_j) { _oA[_j] = a(_j); } 66 byte _oB = b(); 67 _o.setB(_oB); 68 byte[] _oC = _o.getC(); 69 for (int _j = 0; _j < 2; ++_j) { _oC[_j] = c(_j); } 70 long[] _oD = _o.getD(); 71 for (int _j = 0; _j < 2; ++_j) { _oD[_j] = d(_j); } 72 } pack(FlatBufferBuilder builder, NestedStructT _o)73 public static int pack(FlatBufferBuilder builder, NestedStructT _o) { 74 if (_o == null) return 0; 75 int[] _a = _o.getA(); 76 byte[] _c = _o.getC(); 77 long[] _d = _o.getD(); 78 return createNestedStruct( 79 builder, 80 _a, 81 _o.getB(), 82 _c, 83 _d); 84 } 85 } 86 87