Home | History | Annotate | Download | only in Example
      1 // automatically generated by the FlatBuffers compiler, do not modify
      2 
      3 package MyGame.Example;
      4 
      5 import java.nio.*;
      6 import java.lang.*;
      7 import java.util.*;
      8 import com.google.flatbuffers.*;
      9 
     10 @SuppressWarnings("unused")
     11 public final class Stat extends Table {
     12   public static Stat getRootAsStat(ByteBuffer _bb) { return getRootAsStat(_bb, new Stat()); }
     13   public static Stat getRootAsStat(ByteBuffer _bb, Stat obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
     14   public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
     15   public Stat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
     16 
     17   public String id() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; }
     18   public ByteBuffer idAsByteBuffer() { return __vector_as_bytebuffer(4, 1); }
     19   public long val() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
     20   public boolean mutateVal(long val) { int o = __offset(6); if (o != 0) { bb.putLong(o + bb_pos, val); return true; } else { return false; } }
     21   public int count() { int o = __offset(8); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
     22   public boolean mutateCount(int count) { int o = __offset(8); if (o != 0) { bb.putShort(o + bb_pos, (short)count); return true; } else { return false; } }
     23 
     24   public static int createStat(FlatBufferBuilder builder,
     25       int idOffset,
     26       long val,
     27       int count) {
     28     builder.startObject(3);
     29     Stat.addVal(builder, val);
     30     Stat.addId(builder, idOffset);
     31     Stat.addCount(builder, count);
     32     return Stat.endStat(builder);
     33   }
     34 
     35   public static void startStat(FlatBufferBuilder builder) { builder.startObject(3); }
     36   public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addOffset(0, idOffset, 0); }
     37   public static void addVal(FlatBufferBuilder builder, long val) { builder.addLong(1, val, 0L); }
     38   public static void addCount(FlatBufferBuilder builder, int count) { builder.addShort(2, (short)count, (short)0); }
     39   public static int endStat(FlatBufferBuilder builder) {
     40     int o = builder.endObject();
     41     return o;
     42   }
     43 }
     44 
     45