Package org.lwjgl.odbc
Class SQL_NUMERIC_STRUCT
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct SQL_NUMERIC_STRUCT {
SQLCHAR precision;
SQLSCHAR scale;
SQLCHAR sign;
SQLCHAR val[SQL_MAX_NUMERIC_LEN];
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSQL_NUMERIC_STRUCT(ByteBuffer container) Creates aSQL_NUMERIC_STRUCTinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic SQL_NUMERIC_STRUCTcalloc()Returns a newSQL_NUMERIC_STRUCTinstance allocated withmemCalloc.static SQL_NUMERIC_STRUCT.Buffercalloc(int capacity) Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated withmemCalloc.static SQL_NUMERIC_STRUCT.Buffercalloc(int capacity, MemoryStack stack) Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static SQL_NUMERIC_STRUCTcalloc(MemoryStack stack) Returns a newSQL_NUMERIC_STRUCTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static SQL_NUMERIC_STRUCTcreate()Returns a newSQL_NUMERIC_STRUCTinstance allocated withBufferUtils.static SQL_NUMERIC_STRUCT.Buffercreate(int capacity) Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated withBufferUtils.static SQL_NUMERIC_STRUCTcreate(long address) Returns a newSQL_NUMERIC_STRUCTinstance for the specified memory address.static SQL_NUMERIC_STRUCT.Buffercreate(long address, int capacity) Create aSQL_NUMERIC_STRUCT.Bufferinstance at the specified memory.static @Nullable SQL_NUMERIC_STRUCTcreateSafe(long address) static @Nullable SQL_NUMERIC_STRUCT.BuffercreateSafe(long address, int capacity) static SQL_NUMERIC_STRUCTmalloc()Returns a newSQL_NUMERIC_STRUCTinstance allocated withmemAlloc.static SQL_NUMERIC_STRUCT.Buffermalloc(int capacity) Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated withmemAlloc.static SQL_NUMERIC_STRUCT.Buffermalloc(int capacity, MemoryStack stack) Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated on the specifiedMemoryStack.static SQL_NUMERIC_STRUCTmalloc(MemoryStack stack) Returns a newSQL_NUMERIC_STRUCTinstance allocated on the specifiedMemoryStack.static bytenprecision(long struct) Unsafe version ofprecision().static voidnprecision(long struct, byte value) Unsafe version ofprecision.static bytenscale(long struct) Unsafe version ofscale().static voidnscale(long struct, byte value) Unsafe version ofscale.static bytensign(long struct) Unsafe version ofsign().static voidnsign(long struct, byte value) Unsafe version ofsign.static ByteBuffernval(long struct) Unsafe version ofval().static bytenval(long struct, int index) Unsafe version ofval.static voidnval(long struct, int index, byte value) Unsafe version ofval.static voidnval(long struct, ByteBuffer value) Unsafe version ofval.byteprecision(byte value) Sets the specified value to theprecisionfield.bytescale()scale(byte value) Sets the specified value to thescalefield.set(byte precision, byte scale, byte sign, ByteBuffer val) Initializes this struct with the specified values.set(SQL_NUMERIC_STRUCT src) Copies the specified struct data to this struct.bytesign()sign(byte value) Sets the specified value to thesignfield.intsizeof()Returnssizeof(struct).val()byteval(int index) val(int index, byte value) Sets the specified value at the specified index of thevalfield.val(ByteBuffer value) Copies the specifiedByteBufferto thevalfield.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
PRECISION
public static final int PRECISIONThe struct member offsets. -
SCALE
public static final int SCALEThe struct member offsets. -
SIGN
public static final int SIGNThe struct member offsets. -
VAL
public static final int VALThe struct member offsets.
-
-
Constructor Details
-
SQL_NUMERIC_STRUCT
Creates aSQL_NUMERIC_STRUCTinstance at the current position of the specifiedByteBuffercontainer. 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:StructReturnssizeof(struct).- Specified by:
sizeofin classStruct<SQL_NUMERIC_STRUCT>
-
precision
public byte precision()- Returns:
- the value of the
precisionfield.
-
scale
public byte scale()- Returns:
- the value of the
scalefield.
-
sign
public byte sign()- Returns:
- the value of the
signfield.
-
val
- Returns:
- a
ByteBufferview of thevalfield.
-
val
public byte val(int index) - Returns:
- the value at the specified index of the
valfield.
-
precision
Sets the specified value to theprecisionfield. -
scale
Sets the specified value to thescalefield. -
sign
Sets the specified value to thesignfield. -
val
Copies the specifiedByteBufferto thevalfield. -
val
Sets the specified value at the specified index of thevalfield. -
set
Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newSQL_NUMERIC_STRUCTinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newSQL_NUMERIC_STRUCTinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newSQL_NUMERIC_STRUCTinstance allocated withBufferUtils. -
create
Returns a newSQL_NUMERIC_STRUCTinstance for the specified memory address. -
createSafe
-
malloc
Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aSQL_NUMERIC_STRUCT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newSQL_NUMERIC_STRUCTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newSQL_NUMERIC_STRUCTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newSQL_NUMERIC_STRUCT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
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
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
Unsafe version ofval. -
nval
public static void nval(long struct, int index, byte value) Unsafe version ofval.
-