-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathVecTable.java
More file actions
50 lines (43 loc) · 2.83 KB
/
VecTable.java
File metadata and controls
50 lines (43 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// automatically generated by the FlatBuffers compiler, do not modify
package battlecode.schema;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@SuppressWarnings("unused")
/**
* A table of vectors.
*/
public final class VecTable extends Table {
public static VecTable getRootAsVecTable(ByteBuffer _bb) { return getRootAsVecTable(_bb, new VecTable()); }
public static VecTable getRootAsVecTable(ByteBuffer _bb, VecTable obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
public VecTable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public int xs(int j) { int o = __offset(4); return o != 0 ? bb.getInt(__vector(o) + j * 4) : 0; }
public int xsLength() { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; }
public ByteBuffer xsAsByteBuffer() { return __vector_as_bytebuffer(4, 4); }
public ByteBuffer xsInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 4, 4); }
public int ys(int j) { int o = __offset(6); return o != 0 ? bb.getInt(__vector(o) + j * 4) : 0; }
public int ysLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }
public ByteBuffer ysAsByteBuffer() { return __vector_as_bytebuffer(6, 4); }
public ByteBuffer ysInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 6, 4); }
public static int createVecTable(FlatBufferBuilder builder,
int xsOffset,
int ysOffset) {
builder.startObject(2);
VecTable.addYs(builder, ysOffset);
VecTable.addXs(builder, xsOffset);
return VecTable.endVecTable(builder);
}
public static void startVecTable(FlatBufferBuilder builder) { builder.startObject(2); }
public static void addXs(FlatBufferBuilder builder, int xsOffset) { builder.addOffset(0, xsOffset, 0); }
public static int createXsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addInt(data[i]); return builder.endVector(); }
public static void startXsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
public static void addYs(FlatBufferBuilder builder, int ysOffset) { builder.addOffset(1, ysOffset, 0); }
public static int createYsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addInt(data[i]); return builder.endVector(); }
public static void startYsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
public static int endVecTable(FlatBufferBuilder builder) {
int o = builder.endObject();
return o;
}
}