Class SQL_TIME_STRUCT

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

    public class SQL_TIME_STRUCT
    extends Struct
    implements NativeResource

    Layout

    
     struct SQL_TIME_STRUCT {
         SQLUSMALLINT hour;
         SQLUSMALLINT minute;
         SQLUSMALLINT second;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HOUR, MINUTE, SECOND

        The struct member offsets.
    • Constructor Detail

      • SQL_TIME_STRUCT

        public SQL_TIME_STRUCT​(java.nio.ByteBuffer container)
        Creates a SQL_TIME_STRUCT 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • hour

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

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

        public short second()
        Returns the value of the second field.
      • hour

        public SQL_TIME_STRUCT hour​(short value)
        Sets the specified value to the hour field.
      • minute

        public SQL_TIME_STRUCT minute​(short value)
        Sets the specified value to the minute field.
      • second

        public SQL_TIME_STRUCT second​(short value)
        Sets the specified value to the second field.
      • set

        public SQL_TIME_STRUCT set​(short hour,
                                   short minute,
                                   short second)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static short nsecond​(long struct)
        Unsafe version of second().
      • nhour

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

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

        public static void nsecond​(long struct,
                                   short value)
        Unsafe version of second.