...
1// automatically generated by the FlatBuffers compiler, do not modify
2
3package MyGame.Example;
4
5import com.google.flatbuffers.BaseVector;
6import com.google.flatbuffers.BooleanVector;
7import com.google.flatbuffers.ByteVector;
8import com.google.flatbuffers.Constants;
9import com.google.flatbuffers.DoubleVector;
10import com.google.flatbuffers.FlatBufferBuilder;
11import com.google.flatbuffers.FloatVector;
12import com.google.flatbuffers.IntVector;
13import com.google.flatbuffers.LongVector;
14import com.google.flatbuffers.ShortVector;
15import com.google.flatbuffers.StringVector;
16import com.google.flatbuffers.Struct;
17import com.google.flatbuffers.Table;
18import com.google.flatbuffers.UnionVector;
19import java.nio.ByteBuffer;
20import java.nio.ByteOrder;
21
22@SuppressWarnings("unused")
23public final class ArrayStruct extends Struct {
24 public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
25 public ArrayStruct __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
26
27 public float a() { return bb.getFloat(bb_pos + 0); }
28 public void mutateA(float a) { bb.putFloat(bb_pos + 0, a); }
29 public int b(int j) { return bb.getInt(bb_pos + 4 + j * 4); }
30 public void mutateB(int j, int b) { bb.putInt(bb_pos + 4 + j * 4, b); }
31 public byte c() { return bb.get(bb_pos + 64); }
32 public void mutateC(byte c) { bb.put(bb_pos + 64, c); }
33 public MyGame.Example.NestedStruct d(int j) { return d(new MyGame.Example.NestedStruct(), j); }
34 public MyGame.Example.NestedStruct d(MyGame.Example.NestedStruct obj, int j) { return obj.__assign(bb_pos + 72 + j * 32, bb); }
35 public int e() { return bb.getInt(bb_pos + 136); }
36 public void mutateE(int e) { bb.putInt(bb_pos + 136, e); }
37 public long f(int j) { return bb.getLong(bb_pos + 144 + j * 8); }
38 public void mutateF(int j, long f) { bb.putLong(bb_pos + 144 + j * 8, f); }
39
40 public static int createArrayStruct(FlatBufferBuilder builder, float a, int[] b, byte c, int[][] d_a, byte[] d_b, byte[][] d_c, long[][] d_d, int e, long[] f) {
41 builder.prep(8, 160);
42 for (int _idx0 = 2; _idx0 > 0; _idx0--) {
43 builder.putLong(f[_idx0-1]);
44 }
45 builder.pad(4);
46 builder.putInt(e);
47 for (int _idx0 = 2; _idx0 > 0; _idx0--) {
48 builder.prep(8, 32);
49 for (int _idx1 = 2; _idx1 > 0; _idx1--) {
50 builder.putLong(d_d[_idx0-1][_idx1-1]);
51 }
52 builder.pad(5);
53 for (int _idx1 = 2; _idx1 > 0; _idx1--) {
54 builder.putByte(d_c[_idx0-1][_idx1-1]);
55 }
56 builder.putByte(d_b[_idx0-1]);
57 for (int _idx1 = 2; _idx1 > 0; _idx1--) {
58 builder.putInt(d_a[_idx0-1][_idx1-1]);
59 }
60 }
61 builder.pad(7);
62 builder.putByte(c);
63 for (int _idx0 = 15; _idx0 > 0; _idx0--) {
64 builder.putInt(b[_idx0-1]);
65 }
66 builder.putFloat(a);
67 return builder.offset();
68 }
69
70 public static final class Vector extends BaseVector {
71 public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
72
73 public ArrayStruct get(int j) { return get(new ArrayStruct(), j); }
74 public ArrayStruct get(ArrayStruct obj, int j) { return obj.__assign(__element(j), bb); }
75 }
76 public ArrayStructT unpack() {
77 ArrayStructT _o = new ArrayStructT();
78 unpackTo(_o);
79 return _o;
80 }
81 public void unpackTo(ArrayStructT _o) {
82 float _oA = a();
83 _o.setA(_oA);
84 int[] _oB = _o.getB();
85 for (int _j = 0; _j < 15; ++_j) { _oB[_j] = b(_j); }
86 byte _oC = c();
87 _o.setC(_oC);
88 MyGame.Example.NestedStructT[] _oD = _o.getD();
89 for (int _j = 0; _j < 2; ++_j) { _oD[_j] = d(_j).unpack(); }
90 int _oE = e();
91 _o.setE(_oE);
92 long[] _oF = _o.getF();
93 for (int _j = 0; _j < 2; ++_j) { _oF[_j] = f(_j); }
94 }
95 public static int pack(FlatBufferBuilder builder, ArrayStructT _o) {
96 if (_o == null) return 0;
97 int[] _b = _o.getB();
98 int[][] _d_a = new int[2][2];
99 for (int idx0 = 0; idx0 < 2; ++idx0) {for (int idx1 = 0; idx1 < 2; ++idx1) {_d_a[idx0][idx1] = _o.getD()[idx0].getA()[idx1];}}
100 byte[] _d_b = new byte[2];
101 for (int idx0 = 0; idx0 < 2; ++idx0) {_d_b[idx0] = _o.getD()[idx0].getB();}
102 byte[][] _d_c = new byte[2][2];
103 for (int idx0 = 0; idx0 < 2; ++idx0) {for (int idx1 = 0; idx1 < 2; ++idx1) {_d_c[idx0][idx1] = _o.getD()[idx0].getC()[idx1];}}
104 long[][] _d_d = new long[2][2];
105 for (int idx0 = 0; idx0 < 2; ++idx0) {for (int idx1 = 0; idx1 < 2; ++idx1) {_d_d[idx0][idx1] = _o.getD()[idx0].getD()[idx1];}}
106 long[] _f = _o.getF();
107 return createArrayStruct(
108 builder,
109 _o.getA(),
110 _b,
111 _o.getC(),
112 _d_a,
113 _d_b,
114 _d_c,
115 _d_d,
116 _o.getE(),
117 _f);
118 }
119}
120
View as plain text