Package org.lwjgl.odbc
Class SQL_NUMERIC_STRUCT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.odbc.SQL_NUMERIC_STRUCT
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class SQL_NUMERIC_STRUCT extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Layout
struct SQL_NUMERIC_STRUCT { SQLCHAR precision; SQLSCHAR scale; SQLCHAR sign; SQLCHAR val[SQL_MAX_NUMERIC_LEN]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SQL_NUMERIC_STRUCT.Buffer
An array ofSQL_NUMERIC_STRUCT
structs.
-
Constructor Summary
Constructors Constructor Description SQL_NUMERIC_STRUCT(java.nio.ByteBuffer container)
Creates aSQL_NUMERIC_STRUCT
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SQL_NUMERIC_STRUCT
calloc()
Returns a newSQL_NUMERIC_STRUCT
instance allocated withmemCalloc
.static SQL_NUMERIC_STRUCT.Buffer
calloc(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated withmemCalloc
.static SQL_NUMERIC_STRUCT
callocStack()
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static SQL_NUMERIC_STRUCT.Buffer
callocStack(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static SQL_NUMERIC_STRUCT.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static SQL_NUMERIC_STRUCT
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static SQL_NUMERIC_STRUCT
create()
Returns a newSQL_NUMERIC_STRUCT
instance allocated withBufferUtils
.static SQL_NUMERIC_STRUCT.Buffer
create(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated withBufferUtils
.static SQL_NUMERIC_STRUCT
create(long address)
Returns a newSQL_NUMERIC_STRUCT
instance for the specified memory address.static SQL_NUMERIC_STRUCT.Buffer
create(long address, int capacity)
Create aSQL_NUMERIC_STRUCT.Buffer
instance at the specified memory.static SQL_NUMERIC_STRUCT
createSafe(long address)
static SQL_NUMERIC_STRUCT.Buffer
createSafe(long address, int capacity)
static SQL_NUMERIC_STRUCT
malloc()
Returns a newSQL_NUMERIC_STRUCT
instance allocated withmemAlloc
.static SQL_NUMERIC_STRUCT.Buffer
malloc(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated withmemAlloc
.static SQL_NUMERIC_STRUCT
mallocStack()
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the thread-localMemoryStack
.static SQL_NUMERIC_STRUCT.Buffer
mallocStack(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the thread-localMemoryStack
.static SQL_NUMERIC_STRUCT.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the specifiedMemoryStack
.static SQL_NUMERIC_STRUCT
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the specifiedMemoryStack
.static byte
nprecision(long struct)
Unsafe version ofprecision()
.static void
nprecision(long struct, byte value)
Unsafe version ofprecision
.static byte
nscale(long struct)
Unsafe version ofscale()
.static void
nscale(long struct, byte value)
Unsafe version ofscale
.static byte
nsign(long struct)
Unsafe version ofsign()
.static void
nsign(long struct, byte value)
Unsafe version ofsign
.static java.nio.ByteBuffer
nval(long struct)
Unsafe version ofval()
.static byte
nval(long struct, int index)
Unsafe version ofval
.static void
nval(long struct, int index, byte value)
Unsafe version ofval
.static void
nval(long struct, java.nio.ByteBuffer value)
Unsafe version ofval
.byte
precision()
Returns the value of theprecision
field.SQL_NUMERIC_STRUCT
precision(byte value)
Sets the specified value to theprecision
field.byte
scale()
Returns the value of thescale
field.SQL_NUMERIC_STRUCT
scale(byte value)
Sets the specified value to thescale
field.SQL_NUMERIC_STRUCT
set(byte precision, byte scale, byte sign, java.nio.ByteBuffer val)
Initializes this struct with the specified values.SQL_NUMERIC_STRUCT
set(SQL_NUMERIC_STRUCT src)
Copies the specified struct data to this struct.byte
sign()
Returns the value of thesign
field.SQL_NUMERIC_STRUCT
sign(byte value)
Sets the specified value to thesign
field.int
sizeof()
java.nio.ByteBuffer
val()
Returns aByteBuffer
view of theval
field.byte
val(int index)
Returns the value at the specified index of theval
field.SQL_NUMERIC_STRUCT
val(int index, byte value)
Sets the specified value at the specified index of theval
field.SQL_NUMERIC_STRUCT
val(java.nio.ByteBuffer value)
Copies the specifiedByteBuffer
to theval
field.
-
-
-
Constructor Detail
-
SQL_NUMERIC_STRUCT
public SQL_NUMERIC_STRUCT(java.nio.ByteBuffer container)
Creates aSQL_NUMERIC_STRUCT
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
precision
public byte precision()
Returns the value of theprecision
field.
-
scale
public byte scale()
Returns the value of thescale
field.
-
sign
public byte sign()
Returns the value of thesign
field.
-
val
public java.nio.ByteBuffer val()
Returns aByteBuffer
view of theval
field.
-
val
public byte val(int index)
Returns the value at the specified index of theval
field.
-
precision
public SQL_NUMERIC_STRUCT precision(byte value)
Sets the specified value to theprecision
field.
-
scale
public SQL_NUMERIC_STRUCT scale(byte value)
Sets the specified value to thescale
field.
-
sign
public SQL_NUMERIC_STRUCT sign(byte value)
Sets the specified value to thesign
field.
-
val
public SQL_NUMERIC_STRUCT val(java.nio.ByteBuffer value)
Copies the specifiedByteBuffer
to theval
field.
-
val
public SQL_NUMERIC_STRUCT val(int index, byte value)
Sets the specified value at the specified index of theval
field.
-
set
public SQL_NUMERIC_STRUCT set(byte precision, byte scale, byte sign, java.nio.ByteBuffer val)
Initializes this struct with the specified values.
-
set
public SQL_NUMERIC_STRUCT set(SQL_NUMERIC_STRUCT src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static SQL_NUMERIC_STRUCT malloc()
Returns a newSQL_NUMERIC_STRUCT
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static SQL_NUMERIC_STRUCT calloc()
Returns a newSQL_NUMERIC_STRUCT
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static SQL_NUMERIC_STRUCT create()
Returns a newSQL_NUMERIC_STRUCT
instance allocated withBufferUtils
.
-
create
public static SQL_NUMERIC_STRUCT create(long address)
Returns a newSQL_NUMERIC_STRUCT
instance for the specified memory address.
-
createSafe
@Nullable public static SQL_NUMERIC_STRUCT createSafe(long address)
-
malloc
public static SQL_NUMERIC_STRUCT.Buffer malloc(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static SQL_NUMERIC_STRUCT.Buffer calloc(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static SQL_NUMERIC_STRUCT.Buffer create(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static SQL_NUMERIC_STRUCT.Buffer create(long address, int capacity)
Create aSQL_NUMERIC_STRUCT.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static SQL_NUMERIC_STRUCT.Buffer createSafe(long address, int capacity)
-
mallocStack
public static SQL_NUMERIC_STRUCT mallocStack()
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static SQL_NUMERIC_STRUCT callocStack()
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static SQL_NUMERIC_STRUCT mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static SQL_NUMERIC_STRUCT callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static SQL_NUMERIC_STRUCT.Buffer mallocStack(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static SQL_NUMERIC_STRUCT.Buffer callocStack(int capacity)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static SQL_NUMERIC_STRUCT.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static SQL_NUMERIC_STRUCT.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSQL_NUMERIC_STRUCT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nprecision
public static byte nprecision(long struct)
Unsafe version ofprecision()
.
-
nscale
public static byte nscale(long struct)
Unsafe version ofscale()
.
-
nsign
public static byte nsign(long struct)
Unsafe version ofsign()
.
-
nval
public static java.nio.ByteBuffer nval(long struct)
Unsafe version ofval()
.
-
nval
public static byte nval(long struct, int index)
Unsafe version ofval
.
-
nprecision
public static void nprecision(long struct, byte value)
Unsafe version ofprecision
.
-
nscale
public static void nscale(long struct, byte value)
Unsafe version ofscale
.
-
nsign
public static void nsign(long struct, byte value)
Unsafe version ofsign
.
-
nval
public static void nval(long struct, java.nio.ByteBuffer value)
Unsafe version ofval
.
-
nval
public static void nval(long struct, int index, byte value)
Unsafe version ofval
.
-
-