Package org.lwjgl.sdl

Class SDL_DateTime

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_DateTime extends Struct<SDL_DateTime> implements NativeResource

 struct SDL_DateTime {
     int year;
     int month;
     int day;
     int hour;
     int minute;
     int second;
     int nanosecond;
     int day_of_week;
     int utc_offset;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int YEAR
      The struct member offsets.
    • MONTH

      public static final int MONTH
      The struct member offsets.
    • DAY

      public static final int DAY
      The struct member offsets.
    • HOUR

      public static final int HOUR
      The struct member offsets.
    • MINUTE

      public static final int MINUTE
      The struct member offsets.
    • SECOND

      public static final int SECOND
      The struct member offsets.
    • NANOSECOND

      public static final int NANOSECOND
      The struct member offsets.
    • DAY_OF_WEEK

      public static final int DAY_OF_WEEK
      The struct member offsets.
    • UTC_OFFSET

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

    • SDL_DateTime

      public SDL_DateTime(ByteBuffer container)
      Creates a SDL_DateTime 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<SDL_DateTime>
    • year

      public int year()
      Returns:
      the value of the year field.
    • month

      public int month()
      Returns:
      the value of the month field.
    • day

      public int day()
      Returns:
      the value of the day field.
    • hour

      public int hour()
      Returns:
      the value of the hour field.
    • minute

      public int minute()
      Returns:
      the value of the minute field.
    • second

      public int second()
      Returns:
      the value of the second field.
    • nanosecond

      public int nanosecond()
      Returns:
      the value of the nanosecond field.
    • day_of_week

      public int day_of_week()
      Returns:
      the value of the day_of_week field.
    • utc_offset

      public int utc_offset()
      Returns:
      the value of the utc_offset field.
    • year

      public SDL_DateTime year(int value)
      Sets the specified value to the year field.
    • month

      public SDL_DateTime month(int value)
      Sets the specified value to the month field.
    • day

      public SDL_DateTime day(int value)
      Sets the specified value to the day field.
    • hour

      public SDL_DateTime hour(int value)
      Sets the specified value to the hour field.
    • minute

      public SDL_DateTime minute(int value)
      Sets the specified value to the minute field.
    • second

      public SDL_DateTime second(int value)
      Sets the specified value to the second field.
    • nanosecond

      public SDL_DateTime nanosecond(int value)
      Sets the specified value to the nanosecond field.
    • day_of_week

      public SDL_DateTime day_of_week(int value)
      Sets the specified value to the day_of_week field.
    • utc_offset

      public SDL_DateTime utc_offset(int value)
      Sets the specified value to the utc_offset field.
    • set

      public SDL_DateTime set(int year, int month, int day, int hour, int minute, int second, int nanosecond, int day_of_week, int utc_offset)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static SDL_DateTime.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new SDL_DateTime.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
    • nyear

      public static int nyear(long struct)
      Unsafe version of year().
    • nmonth

      public static int nmonth(long struct)
      Unsafe version of month().
    • nday

      public static int nday(long struct)
      Unsafe version of day().
    • nhour

      public static int nhour(long struct)
      Unsafe version of hour().
    • nminute

      public static int nminute(long struct)
      Unsafe version of minute().
    • nsecond

      public static int nsecond(long struct)
      Unsafe version of second().
    • nnanosecond

      public static int nnanosecond(long struct)
      Unsafe version of nanosecond().
    • nday_of_week

      public static int nday_of_week(long struct)
      Unsafe version of day_of_week().
    • nutc_offset

      public static int nutc_offset(long struct)
      Unsafe version of utc_offset().
    • nyear

      public static void nyear(long struct, int value)
      Unsafe version of year.
    • nmonth

      public static void nmonth(long struct, int value)
      Unsafe version of month.
    • nday

      public static void nday(long struct, int value)
      Unsafe version of day.
    • nhour

      public static void nhour(long struct, int value)
      Unsafe version of hour.
    • nminute

      public static void nminute(long struct, int value)
      Unsafe version of minute.
    • nsecond

      public static void nsecond(long struct, int value)
      Unsafe version of second.
    • nnanosecond

      public static void nnanosecond(long struct, int value)
      Unsafe version of nanosecond.
    • nday_of_week

      public static void nday_of_week(long struct, int value)
      Unsafe version of day_of_week.
    • nutc_offset

      public static void nutc_offset(long struct, int value)
      Unsafe version of utc_offset.