Class YGValue

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class YGValue
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct YGValue {
         float value;
         YGUnit unit;
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  YGValue.Buffer
      An array of YGValue structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int SIZEOF
      The struct size in bytes.
      static int UNIT
      VALUE
      The struct member offsets.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      YGValue​(java.nio.ByteBuffer container)
      Creates a YGValue instance at the current position of the specified ByteBuffer container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static YGValue calloc()
      Returns a new YGValue instance allocated with memCalloc.
      static YGValue.Buffer calloc​(int capacity)
      Returns a new YGValue.Buffer instance allocated with memCalloc.
      static YGValue callocStack()
      Returns a new YGValue instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      static YGValue.Buffer callocStack​(int capacity)
      Returns a new YGValue.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      static YGValue.Buffer callocStack​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new YGValue.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static YGValue callocStack​(org.lwjgl.system.MemoryStack stack)
      Returns a new YGValue instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static YGValue create()
      Returns a new YGValue instance allocated with BufferUtils.
      static YGValue.Buffer create​(int capacity)
      Returns a new YGValue.Buffer instance allocated with BufferUtils.
      static YGValue create​(long address)
      Returns a new YGValue instance for the specified memory address.
      static YGValue.Buffer create​(long address, int capacity)
      Create a YGValue.Buffer instance at the specified memory.
      static YGValue createSafe​(long address)
      Like create, but returns null if address is NULL.
      static YGValue.Buffer createSafe​(long address, int capacity)
      Like create, but returns null if address is NULL.
      static YGValue malloc()
      Returns a new YGValue instance allocated with memAlloc.
      static YGValue.Buffer malloc​(int capacity)
      Returns a new YGValue.Buffer instance allocated with memAlloc.
      static YGValue mallocStack()
      Returns a new YGValue instance allocated on the thread-local MemoryStack.
      static YGValue.Buffer mallocStack​(int capacity)
      Returns a new YGValue.Buffer instance allocated on the thread-local MemoryStack.
      static YGValue.Buffer mallocStack​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new YGValue.Buffer instance allocated on the specified MemoryStack.
      static YGValue mallocStack​(org.lwjgl.system.MemoryStack stack)
      Returns a new YGValue instance allocated on the specified MemoryStack.
      static int nunit​(long struct)
      Unsafe version of unit().
      static void nunit​(long struct, int value)
      Unsafe version of unit.
      static float nvalue​(long struct)
      Unsafe version of value().
      static void nvalue​(long struct, float value)
      Unsafe version of value.
      YGValue set​(float value, int unit)
      Initializes this struct with the specified values.
      YGValue set​(YGValue src)
      Copies the specified struct data to this struct.
      int sizeof()  
      int unit()
      Returns the value of the unit field.
      YGValue unit​(int value)
      Sets the specified value to the unit field.
      float value()
      Returns the value of the value field.
      YGValue value​(float value)
      Sets the specified value to the value field.
      • Methods inherited from interface org.lwjgl.system.NativeResource

        close, free
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from class org.lwjgl.system.Pointer.Default

        address, equals, hashCode, toString
      • Methods inherited from class org.lwjgl.system.Struct

        clear, free, isNull
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • VALUE, UNIT

        The struct member offsets.
    • Constructor Detail

      • YGValue

        public YGValue​(java.nio.ByteBuffer container)
        Creates a YGValue 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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • value

        public float value()
        Returns the value of the value field.
      • unit

        public int unit()
        Returns the value of the unit field.
      • value

        public YGValue value​(float value)
        Sets the specified value to the value field.
      • unit

        public YGValue unit​(int value)
        Sets the specified value to the unit field.
      • set

        public YGValue set​(float value,
                           int unit)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

        public static YGValue mallocStack()
        Returns a new YGValue instance allocated on the thread-local MemoryStack.
      • callocStack

        public static YGValue callocStack()
        Returns a new YGValue instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static YGValue mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static YGValue callocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static YGValue.Buffer mallocStack​(int capacity)
        Returns a new YGValue.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static YGValue.Buffer callocStack​(int capacity)
        Returns a new YGValue.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static YGValue.Buffer mallocStack​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static YGValue.Buffer callocStack​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nvalue

        public static float nvalue​(long struct)
        Unsafe version of value().
      • nunit

        public static int nunit​(long struct)
        Unsafe version of unit().
      • nvalue

        public static void nvalue​(long struct,
                                  float value)
        Unsafe version of value.
      • nunit

        public static void nunit​(long struct,
                                 int value)
        Unsafe version of unit.