Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | package MyGame.Example; |
| 4 | |
| 5 | import java.nio.*; |
| 6 | import java.lang.*; |
| 7 | import java.util.*; |
| 8 | import com.google.flatbuffers.*; |
| 9 | |
| 10 | @SuppressWarnings("unused") |
| 11 | public final class NestedStruct extends Struct { |
| 12 | public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); } |
| 13 | public NestedStruct __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 14 | |
| 15 | public int a(int j) { return bb.getInt(bb_pos + 0 + j * 4); } |
| 16 | public void mutateA(int j, int a) { bb.putInt(bb_pos + 0 + j * 4, a); } |
| 17 | public byte b() { return bb.get(bb_pos + 8); } |
| 18 | public void mutateB(byte b) { bb.put(bb_pos + 8, b); } |
| 19 | public byte c(int j) { return bb.get(bb_pos + 9 + j * 1); } |
| 20 | public void mutateC(int j, byte c) { bb.put(bb_pos + 9 + j * 1, c); } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 21 | public long d(int j) { return bb.getLong(bb_pos + 16 + j * 8); } |
| 22 | public void mutateD(int j, long d) { bb.putLong(bb_pos + 16 + j * 8, d); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 23 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 24 | public static int createNestedStruct(FlatBufferBuilder builder, int[] a, byte b, byte[] c, long[] d) { |
| 25 | builder.prep(8, 32); |
| 26 | for (int _idx0 = 2; _idx0 > 0; _idx0--) { |
| 27 | builder.putLong(d[_idx0-1]); |
| 28 | } |
| 29 | builder.pad(5); |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 30 | for (int _idx0 = 2; _idx0 > 0; _idx0--) { |
| 31 | builder.putByte(c[_idx0-1]); |
| 32 | } |
| 33 | builder.putByte(b); |
| 34 | for (int _idx0 = 2; _idx0 > 0; _idx0--) { |
| 35 | builder.putInt(a[_idx0-1]); |
| 36 | } |
| 37 | return builder.offset(); |
| 38 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame^] | 39 | |
| 40 | public static final class Vector extends BaseVector { |
| 41 | public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; } |
| 42 | |
| 43 | public NestedStruct get(int j) { return get(new NestedStruct(), j); } |
| 44 | public NestedStruct get(NestedStruct obj, int j) { return obj.__assign(__element(j), bb); } |
| 45 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 46 | } |
| 47 | |