blob: d3081e619295ee721287fc61a454b076b44a0a46 [file] [log] [blame]
Austin Schuhe89fa2d2019-08-14 20:24:23 -07001// automatically generated by the FlatBuffers compiler, do not modify
2
3package MyGame.Example;
4
5import java.nio.*;
6import java.lang.*;
7import java.util.*;
8import com.google.flatbuffers.*;
9
10@SuppressWarnings("unused")
11public 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 Schuh272c6132020-11-14 16:37:52 -080021 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 Schuhe89fa2d2019-08-14 20:24:23 -070023
Austin Schuh272c6132020-11-14 16:37:52 -080024 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 Schuhe89fa2d2019-08-14 20:24:23 -070030 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 Schuh272c6132020-11-14 16:37:52 -080039
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 }
James Kuszmaul8e62b022022-03-22 09:33:25 -070046 public NestedStructT unpack() {
47 NestedStructT _o = new NestedStructT();
48 unpackTo(_o);
49 return _o;
50 }
51 public void unpackTo(NestedStructT _o) {
52 int[] _oA = _o.getA();
53 for (int _j = 0; _j < 2; ++_j) { _oA[_j] = a(_j); }
54 byte _oB = b();
55 _o.setB(_oB);
56 byte[] _oC = _o.getC();
57 for (int _j = 0; _j < 2; ++_j) { _oC[_j] = c(_j); }
58 long[] _oD = _o.getD();
59 for (int _j = 0; _j < 2; ++_j) { _oD[_j] = d(_j); }
60 }
61 public static int pack(FlatBufferBuilder builder, NestedStructT _o) {
62 if (_o == null) return 0;
63 int[] _a = _o.getA();
64 byte[] _c = _o.getC();
65 long[] _d = _o.getD();
66 return createNestedStruct(
67 builder,
68 _a,
69 _o.getB(),
70 _c,
71 _d);
72 }
Austin Schuhe89fa2d2019-08-14 20:24:23 -070073}
74