mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-04 04:33:23 +00:00
* [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521)
This commit is contained in:
@@ -21,7 +21,7 @@ public final class Vec3 extends Struct {
|
||||
public double test1() { return bb.getDouble(bb_pos + 16); }
|
||||
public void mutateTest1(double test1) { bb.putDouble(bb_pos + 16, test1); }
|
||||
public int test2() { return bb.get(bb_pos + 24) & 0xFF; }
|
||||
public void mutateTest2(int test2) { bb.put(bb_pos + 24, (byte)test2); }
|
||||
public void mutateTest2(int test2) { bb.put(bb_pos + 24, (byte) test2); }
|
||||
public MyGame.Example.Test test3() { return test3(new MyGame.Example.Test()); }
|
||||
public MyGame.Example.Test test3(MyGame.Example.Test obj) { return obj.__assign(bb_pos + 26, bb); }
|
||||
|
||||
@@ -33,7 +33,7 @@ public final class Vec3 extends Struct {
|
||||
builder.putByte(test3_b);
|
||||
builder.putShort(test3_a);
|
||||
builder.pad(1);
|
||||
builder.putByte((byte)test2);
|
||||
builder.putByte((byte) test2);
|
||||
builder.putDouble(test1);
|
||||
builder.pad(4);
|
||||
builder.putFloat(z);
|
||||
@@ -48,5 +48,37 @@ public final class Vec3 extends Struct {
|
||||
public Vec3 get(int j) { return get(new Vec3(), j); }
|
||||
public Vec3 get(Vec3 obj, int j) { return obj.__assign(__element(j), bb); }
|
||||
}
|
||||
public Vec3T unpack() {
|
||||
Vec3T _o = new Vec3T();
|
||||
unpackTo(_o);
|
||||
return _o;
|
||||
}
|
||||
public void unpackTo(Vec3T _o) {
|
||||
float _oX = x();
|
||||
_o.setX(_oX);
|
||||
float _oY = y();
|
||||
_o.setY(_oY);
|
||||
float _oZ = z();
|
||||
_o.setZ(_oZ);
|
||||
double _oTest1 = test1();
|
||||
_o.setTest1(_oTest1);
|
||||
int _oTest2 = test2();
|
||||
_o.setTest2(_oTest2);
|
||||
test3().unpackTo(_o.getTest3());
|
||||
}
|
||||
public static int pack(FlatBufferBuilder builder, Vec3T _o) {
|
||||
if (_o == null) return 0;
|
||||
short _test3_a = _o.getTest3().getA();
|
||||
byte _test3_b = _o.getTest3().getB();
|
||||
return createVec3(
|
||||
builder,
|
||||
_o.getX(),
|
||||
_o.getY(),
|
||||
_o.getZ(),
|
||||
_o.getTest1(),
|
||||
_o.getTest2(),
|
||||
_test3_a,
|
||||
_test3_b);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user