Class YGNode.Buffer

All Implemented Interfaces:
AutoCloseable, Iterable<YGNode>, NativeResource, Pointer
Enclosing class:
YGNode

public static class YGNode.Buffer extends StructBuffer<YGNode,YGNode.Buffer> implements NativeResource
An array of YGNode structs.
  • Constructor Details

    • Buffer

      public Buffer(ByteBuffer container)
      Creates a new YGNode.Buffer instance backed by the specified container.

      Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by YGNode.SIZEOF, and its mark will be undefined.

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

    • Buffer

      public Buffer(long address, int cap)
  • Method Details

    • context

      public long context()
      Returns:
      the value of the context field.
    • flags

      public YGNodeFlags flags()
      Returns:
      a YGNodeFlags view of the flags field.
    • measure_noContext

      @Nullable public YGMeasureFunc measure_noContext()
      Returns:
      the value of the measure.noContext field.
    • measure_withContext

      public long measure_withContext()
      Returns:
      the value of the measure.withContext field.
    • baseline_noContext

      @Nullable public YGBaselineFunc baseline_noContext()
      Returns:
      the value of the baseline.noContext field.
    • baseline_withContext

      public long baseline_withContext()
      Returns:
      the value of the baseline.withContext field.
    • dirtied

      @Nullable public YGDirtiedFunc dirtied()
      Returns:
      the value of the dirtied field.
    • style

      public YGStyle style()
      Returns:
      a YGStyle view of the style field.
    • layout

      public YGLayout layout()
      Returns:
      a YGLayout view of the layout field.
    • lineIndex

      public int lineIndex()
      Returns:
      the value of the lineIndex field.
    • owner

      public long owner()
      Returns:
      the value of the owner field.
    • config

      public long config()
      Returns:
      the value of the config field.
    • resolvedDimensions

      public YGValue.Buffer resolvedDimensions()
      Returns:
      a YGValue.Buffer view of the resolvedDimensions field.
    • resolvedDimensions

      public YGValue resolvedDimensions(int index)
      Returns:
      a YGValue view of the struct at the specified index of the resolvedDimensions field.
    • context

      public YGNode.Buffer context(long value)
      Sets the specified value to the context field.
    • flags

      public YGNode.Buffer flags(YGNodeFlags value)
      Copies the specified YGNodeFlags to the flags field.
    • flags

      public YGNode.Buffer flags(Consumer<YGNodeFlags> consumer)
      Passes the flags field to the specified Consumer.
    • measure_noContext

      public YGNode.Buffer measure_noContext(@Nullable YGMeasureFuncI value)
      Sets the specified value to the noContext field.
    • measure_withContext

      public YGNode.Buffer measure_withContext(long value)
      Sets the specified value to the withContext field.
    • baseline_noContext

      public YGNode.Buffer baseline_noContext(@Nullable YGBaselineFuncI value)
      Sets the specified value to the noContext field.
    • baseline_withContext

      public YGNode.Buffer baseline_withContext(long value)
      Sets the specified value to the withContext field.
    • dirtied

      public YGNode.Buffer dirtied(@Nullable YGDirtiedFuncI value)
      Sets the specified value to the dirtied field.
    • style

      public YGNode.Buffer style(YGStyle value)
      Copies the specified YGStyle to the style field.
    • layout

      public YGNode.Buffer layout(YGLayout value)
      Copies the specified YGLayout to the layout field.
    • lineIndex

      public YGNode.Buffer lineIndex(int value)
      Sets the specified value to the lineIndex field.
    • owner

      public YGNode.Buffer owner(long value)
      Sets the specified value to the owner field.
    • config

      public YGNode.Buffer config(long value)
      Sets the specified value to the config field.
    • resolvedDimensions

      public YGNode.Buffer resolvedDimensions(YGValue.Buffer value)
      Copies the specified YGValue.Buffer to the resolvedDimensions field.
    • resolvedDimensions

      public YGNode.Buffer resolvedDimensions(int index, YGValue value)
      Copies the specified YGValue at the specified index of the resolvedDimensions field.
    • resolvedDimensions

      public YGNode.Buffer resolvedDimensions(Consumer<YGValue.Buffer> consumer)
      Passes the resolvedDimensions field to the specified Consumer.
    • resolvedDimensions

      public YGNode.Buffer resolvedDimensions(int index, Consumer<YGValue> consumer)
      Passes the element at index of the resolvedDimensions field to the specified Consumer.