...

Text file src/github.com/google/flatbuffers/tests/union_vector/HandFan.java

Documentation: github.com/google/flatbuffers/tests/union_vector

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

View as plain text