Class hb_var_num_t

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class hb_var_num_t extends Struct<hb_var_num_t> implements NativeResource

 union hb_var_num_t {
     float f;
     uint32_t u32;
     int32_t i32;
     uint16_t u16[2];
     int16_t i16[2];
     uint8_t u8[4];
     int8_t i8[4];
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • F

      public static final int F
      The struct member offsets.
    • U32

      public static final int U32
      The struct member offsets.
    • I32

      public static final int I32
      The struct member offsets.
    • U16

      public static final int U16
      The struct member offsets.
    • I16

      public static final int I16
      The struct member offsets.
    • U8

      public static final int U8
      The struct member offsets.
    • I8

      public static final int I8
      The struct member offsets.
  • Constructor Details

    • hb_var_num_t

      public hb_var_num_t(ByteBuffer container)
      Creates a hb_var_num_t instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<hb_var_num_t>
    • f

      public float f()
      Returns:
      the value of the f field.
    • u32

      public int u32()
      Returns:
      the value of the u32 field.
    • i32

      public int i32()
      Returns:
      the value of the i32 field.
    • u16

      public ShortBuffer u16()
      Returns:
      a ShortBuffer view of the u16 field.
    • u16

      public short u16(int index)
      Returns:
      the value at the specified index of the u16 field.
    • i16

      public ShortBuffer i16()
      Returns:
      a ShortBuffer view of the i16 field.
    • i16

      public short i16(int index)
      Returns:
      the value at the specified index of the i16 field.
    • u8

      public ByteBuffer u8()
      Returns:
      a ByteBuffer view of the u8 field.
    • u8

      public byte u8(int index)
      Returns:
      the value at the specified index of the u8 field.
    • i8

      public ByteBuffer i8()
      Returns:
      a ByteBuffer view of the i8 field.
    • i8

      public byte i8(int index)
      Returns:
      the value at the specified index of the i8 field.
    • f

      public hb_var_num_t f(float value)
      Sets the specified value to the f field.
    • u32

      public hb_var_num_t u32(int value)
      Sets the specified value to the u32 field.
    • i32

      public hb_var_num_t i32(int value)
      Sets the specified value to the i32 field.
    • u16

      public hb_var_num_t u16(ShortBuffer value)
      Copies the specified ShortBuffer to the u16 field.
    • u16

      public hb_var_num_t u16(int index, short value)
      Sets the specified value at the specified index of the u16 field.
    • i16

      public hb_var_num_t i16(ShortBuffer value)
      Copies the specified ShortBuffer to the i16 field.
    • i16

      public hb_var_num_t i16(int index, short value)
      Sets the specified value at the specified index of the i16 field.
    • u8

      public hb_var_num_t u8(ByteBuffer value)
      Copies the specified ByteBuffer to the u8 field.
    • u8

      public hb_var_num_t u8(int index, byte value)
      Sets the specified value at the specified index of the u8 field.
    • i8

      public hb_var_num_t i8(ByteBuffer value)
      Copies the specified ByteBuffer to the i8 field.
    • i8

      public hb_var_num_t i8(int index, byte value)
      Sets the specified value at the specified index of the i8 field.
    • set

      public hb_var_num_t set(hb_var_num_t src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static hb_var_num_t malloc()
      Returns a new hb_var_num_t instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static hb_var_num_t calloc()
      Returns a new hb_var_num_t instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static hb_var_num_t create()
      Returns a new hb_var_num_t instance allocated with BufferUtils.
    • create

      public static hb_var_num_t create(long address)
      Returns a new hb_var_num_t instance for the specified memory address.
    • createSafe

      public static @Nullable hb_var_num_t createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static hb_var_num_t.Buffer malloc(int capacity)
      Returns a new hb_var_num_t.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static hb_var_num_t.Buffer calloc(int capacity)
      Returns a new hb_var_num_t.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static hb_var_num_t.Buffer create(int capacity)
      Returns a new hb_var_num_t.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static hb_var_num_t.Buffer create(long address, int capacity)
      Create a hb_var_num_t.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable hb_var_num_t.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static hb_var_num_t malloc(MemoryStack stack)
      Returns a new hb_var_num_t instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static hb_var_num_t calloc(MemoryStack stack)
      Returns a new hb_var_num_t instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static hb_var_num_t.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new hb_var_num_t.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static hb_var_num_t.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new hb_var_num_t.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nf

      public static float nf(long struct)
      Unsafe version of f().
    • nu32

      public static int nu32(long struct)
      Unsafe version of u32().
    • ni32

      public static int ni32(long struct)
      Unsafe version of i32().
    • nu16

      public static ShortBuffer nu16(long struct)
      Unsafe version of u16().
    • nu16

      public static short nu16(long struct, int index)
      Unsafe version of u16.
    • ni16

      public static ShortBuffer ni16(long struct)
      Unsafe version of i16().
    • ni16

      public static short ni16(long struct, int index)
      Unsafe version of i16.
    • nu8

      public static ByteBuffer nu8(long struct)
      Unsafe version of u8().
    • nu8

      public static byte nu8(long struct, int index)
      Unsafe version of u8.
    • ni8

      public static ByteBuffer ni8(long struct)
      Unsafe version of i8().
    • ni8

      public static byte ni8(long struct, int index)
      Unsafe version of i8.
    • nf

      public static void nf(long struct, float value)
      Unsafe version of f.
    • nu32

      public static void nu32(long struct, int value)
      Unsafe version of u32.
    • ni32

      public static void ni32(long struct, int value)
      Unsafe version of i32.
    • nu16

      public static void nu16(long struct, ShortBuffer value)
      Unsafe version of u16.
    • nu16

      public static void nu16(long struct, int index, short value)
      Unsafe version of u16.
    • ni16

      public static void ni16(long struct, ShortBuffer value)
      Unsafe version of i16.
    • ni16

      public static void ni16(long struct, int index, short value)
      Unsafe version of i16.
    • nu8

      public static void nu8(long struct, ByteBuffer value)
      Unsafe version of u8.
    • nu8

      public static void nu8(long struct, int index, byte value)
      Unsafe version of u8.
    • ni8

      public static void ni8(long struct, ByteBuffer value)
      Unsafe version of i8.
    • ni8

      public static void ni8(long struct, int index, byte value)
      Unsafe version of i8.