xref: /aosp_15_r20/external/flatbuffers/tests/union_vector/HandFan.java (revision 890232f25432b36107d06881e0a25aaa6b473652)
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 import java.nio.*;
4 import java.lang.*;
5 import java.util.*;
6 import com.google.flatbuffers.*;
7 
8 @SuppressWarnings("unused")
9 public final class HandFan extends Table {
ValidateVersion()10   public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_0(); }
getRootAsHandFan(ByteBuffer _bb)11   public static HandFan getRootAsHandFan(ByteBuffer _bb) { return getRootAsHandFan(_bb, new HandFan()); }
getRootAsHandFan(ByteBuffer _bb, HandFan obj)12   public static HandFan getRootAsHandFan(ByteBuffer _bb, HandFan obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
__init(int _i, ByteBuffer _bb)13   public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
__assign(int _i, ByteBuffer _bb)14   public HandFan __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
15 
length()16   public int length() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
mutateLength(int length)17   public boolean mutateLength(int length) { int o = __offset(4); if (o != 0) { bb.putInt(o + bb_pos, length); return true; } else { return false; } }
18 
createHandFan(FlatBufferBuilder builder, int length)19   public static int createHandFan(FlatBufferBuilder builder,
20       int length) {
21     builder.startTable(1);
22     HandFan.addLength(builder, length);
23     return HandFan.endHandFan(builder);
24   }
25 
startHandFan(FlatBufferBuilder builder)26   public static void startHandFan(FlatBufferBuilder builder) { builder.startTable(1); }
addLength(FlatBufferBuilder builder, int length)27   public static void addLength(FlatBufferBuilder builder, int length) { builder.addInt(0, length, 0); }
endHandFan(FlatBufferBuilder builder)28   public static int endHandFan(FlatBufferBuilder builder) {
29     int o = builder.endTable();
30     return o;
31   }
32 
33   public static final class Vector extends BaseVector {
__assign(int _vector, int _element_size, ByteBuffer _bb)34     public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
35 
get(int j)36     public HandFan get(int j) { return get(new HandFan(), j); }
get(HandFan obj, int j)37     public HandFan get(HandFan obj, int j) {  return obj.__assign(__indirect(__element(j), bb), bb); }
38   }
unpack()39   public HandFanT unpack() {
40     HandFanT _o = new HandFanT();
41     unpackTo(_o);
42     return _o;
43   }
unpackTo(HandFanT _o)44   public void unpackTo(HandFanT _o) {
45     int _oLength = length();
46     _o.setLength(_oLength);
47   }
pack(FlatBufferBuilder builder, HandFanT _o)48   public static int pack(FlatBufferBuilder builder, HandFanT _o) {
49     if (_o == null) return 0;
50     return createHandFan(
51       builder,
52       _o.getLength());
53   }
54 }
55 
56