Class BooleanPtr

All Implemented Interfaces:
Iterable<BooleanPtr>

public final class BooleanPtr
extends Struct<BooleanPtr>
Points to an 8-bit boolean value. When reading 0 is interpreted as false. and non-zero values are interpreted as true. When writing 0 will be written for false and 1 will be written for true.
  • Constructor Details

    • BooleanPtr

      public BooleanPtr()
      Creates a new BooleanPtr with a value of false.
    • BooleanPtr

      public BooleanPtr​(boolean value)
      Creates a new BooleanPtr and initializes it with the specified value.
      Parameters:
      value - the value.
  • Method Details

    • get

      public boolean get()
      Returns the current value.
      Returns:
      the value.
    • set

      public void set​(boolean value)
      Sets the value.
      Parameters:
      value - the new value.
    • toBooleanArray

      public boolean[] toBooleanArray​(int n)
      Copies n booleans from the memory pointed to by this BooleanPtr to a new boolean[] instance.
      Parameters:
      n - the number of booleans to copy.
      Returns:
      the boolean[].
    • get

      public void get​(boolean[] dst)
      Copies dst.length bytes from the memory pointed to by this BooleanPtr to dst.
      Parameters:
      dst - the destination.
    • get

      public void get​(boolean[] dst, int offset, int count)
      Copies count booleans from the memory pointed to by this BooleanPtr to dst starting at offset offset.
      Parameters:
      dst - the destination.
      offset - the offset within the destination array to start copying to.
      count - the number of elements to copy.
    • set

      public void set​(boolean[] src)
      Copies src.length booleans from src to the memory pointed to by this BooleanPtr.
      Parameters:
      src - the source.
    • set

      public void set​(boolean[] src, int offset, int count)
      Copies count booleans from src starting at offset offset to the memory pointed to by this BooleanPtr.
      Parameters:
      src - the source.
      offset - the offset within the source array to start copying from.
      count - the number of elements to copy.