com.google.flatbuffers

## Class Table

- java.lang.Object
- - com.google.flatbuffers.Table

    public class Table
    extends Object

All tables in the generated code derive from this class, and add their own accessors.

### Field Summary

Fields
`protected ByteBuffer` `bb` The underlying ByteBuffer to hold the data of the Table.
`protected int` `bb_pos` Used to hold the position of the `bb` buffer.

### Constructor Summary

Constructors
Constructor and Description
`Table()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected static boolean` `__has_identifier(ByteBuffer bb, String ident)` Check if a `ByteBuffer` contains a file identifier.
`protected int` `__indirect(int offset)` Retrieve a relative offset.
`protected int` `__offset(int vtable_offset)` Look up a field in the vtable.
`protected String` `__string(int offset)` Create a Java `String` from UTF-8 data stored inside the FlatBuffer.
`protected Table` `__union(Table t, int offset)` Initialize any Table-derived type to point to the union at the given `offset`.
`protected ByteBuffer` `__vector_as_bytebuffer(int vector_offset, int elem_size)` Get a whole vector as a ByteBuffer.
`protected int` `__vector_len(int offset)` Get the length of a vector.
`protected int` `__vector(int offset)` Get the start data of a vector.
`ByteBuffer` `getByteBuffer()` Get the underlying ByteBuffer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### bb_pos

    protected int bb_pos

Used to hold the position of the `bb` buffer.

#### bb

    protected ByteBuffer bb

The underlying ByteBuffer to hold the data of the Table.

### Constructor Detail

#### Table

    public Table()

### Method Detail

#### getByteBuffer

    public ByteBuffer getByteBuffer()

Get the underlying ByteBuffer.

Returns:
  Returns the Table's ByteBuffer.

#### __offset

    protected int __offset(int vtable_offset)

Look up a field in the vtable.

Parameters:
  `vtable_offset` - An `int` offset to the vtable in the Table's ByteBuffer.
Returns:
  Returns an offset into the object, or `0` if the field is not present.

#### __indirect

    protected int __indirect(int offset)

Retrieve a relative offset.

Parameters:
  `offset` - An `int` index into the Table's ByteBuffer containing the relative offset.
Returns:
  Returns the relative offset stored at `offset`.

#### __string

    protected String __string(int offset)

Create a Java `String` from UTF-8 data stored inside the FlatBuffer. This allocates a new string and converts to wide chars upon each access, which is not very efficient. Instead, each FlatBuffer string also comes with an accessor based on __vector_as_bytebuffer below, which is much more efficient, assuming your Java program can handle UTF-8 data directly.

Parameters:
  `offset` - An `int` index into the Table's ByteBuffer.
Returns:
  Returns a `String` from the data stored inside the FlatBuffer at `offset`.

#### __vector_len

    protected int __vector_len(int offset)

Get the length of a vector.

Parameters:
  `offset` - An `int` index into the Table's ByteBuffer.
Returns:
  Returns the length of the vector whose offset is stored at `offset`.

#### __vector

    protected int __vector(int offset)

Get the start data of a vector.

Parameters:
  `offset` - An `int` index into the Table's ByteBuffer.
Returns:
  Returns the start of the vector data whose offset is stored at `offset`.

#### __vector_as_bytebuffer

    protected ByteBuffer __vector_as_bytebuffer(int vector_offset,
                                                int elem_size)

Get a whole vector as a ByteBuffer. This is efficient, since it only allocates a new `ByteBuffer` object, but does not actually copy the data, it still refers to the same bytes as the original ByteBuffer. Also useful with nested FlatBuffers, etc.

Parameters:
  `vector_offset` - The position of the vector in the byte buffer
  `elem_size` - The size of each element in the array
Returns:
  The `ByteBuffer` for the array

#### __union

    protected Table __union(Table t,
                            int offset)

Initialize any Table-derived type to point to the union at the given `offset`.

Parameters:
  `t` - A `Table`-derived type that should point to the union at `offset`.
  `offset` - An `int` index into the Table's ByteBuffer.
Returns:
  Returns the Table that points to the union at `offset`.

#### __has_identifier

    protected static boolean __has_identifier(ByteBuffer bb,
                                              String ident)

Check if a `ByteBuffer` contains a file identifier.

Parameters:
  `bb` - A `ByteBuffer` to check if it contains the identifier `ident`.
  `ident` - A `String` identifier of the FlatBuffer file.
Returns:
  True if the buffer contains the file identifier