public class SqlJetVdbeMem extends SqlJetCloneable implements ISqlJetVdbeMem
| Modifier and Type | Field and Description |
|---|---|
static long |
instanceCounter |
static SqlJetVdbeMemPool |
pool |
| Modifier and Type | Method and Description |
|---|---|
void |
applyAffinity(SqlJetTypeAffinity affinity,
SqlJetEncoding enc)
Processing is determine by the affinity parameter:
AFF_INTEGER:
AFF_REAL:
AFF_NUMERIC:
Try to convert value to an integer representation or a floating-point
representation if an integer representation is not possible.
|
void |
applyNumericAffinity()
Try to convert a value into a numeric representation if we can do so
without loss of information.
|
void |
changeEncoding(SqlJetEncoding desiredEnc)
If pMem is an object with a valid string representation, this routine
ensures the internal encoding for the string representation is
'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.
|
static int |
compare(SqlJetVdbeMem pMem1,
SqlJetVdbeMem pMem2,
ISqlJetCollSeq pColl)
Compare the values contained by the two memory cells, returning negative,
zero or positive if pMem1 is less than, equal to, or greater than pMem2.
|
ISqlJetVdbeMem |
copy()
Make a full copy of pFrom into pTo.
|
void |
expandBlob()
If the given Mem* has a zero-filled tail, turn it into an ordinary blob
stored in dynamically allocated space.
|
void |
fromBtree(ISqlJetBtreeCursor pCur,
int offset,
int amt,
boolean key)
Move data out of a btree key or data field and into a Mem structure.
|
java.util.Set<SqlJetVdbeMemFlags> |
getFlags() |
SqlJetValueType |
getType() |
void |
grow(int n,
boolean preserve)
Make sure pMem->z points to a writable allocation of at least n bytes.
|
void |
handleBom()
This routine checks for a byte-order mark at the beginning of the UTF-16
string stored in *pMem.
|
void |
integerAffinity()
The MEM structure is already a MEM_Real.
|
void |
integerify()
Convert pMem to type integer.
|
long |
intValue()
Return some kind of integer value which is the best we can do at
representing the value that *pMem describes as an integer.
|
boolean |
isNull() |
boolean |
isTooBig()
Return true if the Mem object contains a TEXT or BLOB that is too large -
whose size exceeds SQLITE_MAX_LENGTH.
|
void |
makeWriteable()
Make the given Mem object MEM_Dyn.
|
ISqlJetVdbeMem |
move()
Transfer the contents of pFrom to pTo.
|
void |
nulTerminate()
Make sure the given Mem is nul terminated.
|
void |
numerify()
Convert pMem so that it has types MEM_Real or MEM_Int or both.
|
static SqlJetVdbeMem |
obtainInstance() |
void |
realify()
Convert pMem so that it is of type MEM_Real.
|
double |
realValue()
Return the best representation of pMem that we can get into a double.
|
void |
release() |
void |
reset()
Release any memory held by the Mem.
|
void |
sanity()
Perform various checks on the memory cell pMem.
|
void |
setDouble(double val)
Delete any previous value and set the value stored in *pMem to val,
manifest type REAL.
|
void |
setInt64(long val)
Delete any previous value and set the value stored in *pMem to val,
manifest type INTEGER.
|
void |
setNull()
Delete any previous value and set the value stored in *pMem to NULL.
|
void |
setRowSet()
Delete any previous value and set the value of pMem to be an empty
boolean index.
|
void |
setStr(ISqlJetMemoryPointer z,
SqlJetEncoding enc)
Change the value of a Mem to be a string or a BLOB.
|
void |
setTypeFlag(SqlJetVdbeMemFlags f)
Clear any existing type flags from a Mem and replace them with f
|
void |
setZeroBlob(int n)
Delete any previous value and set the value to be a BLOB of length n
containing all zeros.
|
ISqlJetVdbeMem |
shallowCopy(SqlJetVdbeMemFlags srcType)
Make an shallow copy.
|
void |
stringify(SqlJetEncoding enc)
Add MEM_Str to the set of representations for the given Mem.
|
void |
translate(SqlJetEncoding desiredEnc)
This routine transforms the internal text encoding used by pMem to
desiredEnc.
|
ISqlJetMemoryPointer |
valueBlob()
Converts the object V into a BLOB and then returns a pointer to the
converted value.
|
int |
valueBytes(SqlJetEncoding enc)
Return the number of bytes in the sqlite3_value object assuming that it
uses the encoding "enc"
|
ISqlJetMemoryPointer |
valueText(SqlJetEncoding enc)
This function is only available internally, it is not part of the
external API.
|
clonepublic static long instanceCounter
public static final SqlJetVdbeMemPool pool
public static SqlJetVdbeMem obtainInstance()
public void reset()
ISqlJetVdbeMemreset in interface ISqlJetVdbeMempublic void release()
release in interface ISqlJetReleasablepublic static int compare(SqlJetVdbeMem pMem1, SqlJetVdbeMem pMem2, ISqlJetCollSeq pColl) throws SqlJetException
SqlJetExceptionpublic ISqlJetVdbeMem shallowCopy(SqlJetVdbeMemFlags srcType) throws SqlJetException
ISqlJetVdbeMemshallowCopy in interface ISqlJetVdbeMemSqlJetExceptionpublic ISqlJetVdbeMem copy() throws SqlJetException
ISqlJetVdbeMemcopy in interface ISqlJetVdbeMemSqlJetExceptionpublic ISqlJetVdbeMem move() throws SqlJetException
ISqlJetVdbeMemmove in interface ISqlJetVdbeMemSqlJetExceptionpublic ISqlJetMemoryPointer valueText(SqlJetEncoding enc) throws SqlJetException
ISqlJetVdbeMemvalueText in interface ISqlJetVdbeMemSqlJetExceptionpublic void stringify(SqlJetEncoding enc) throws SqlJetException
ISqlJetVdbeMemstringify in interface ISqlJetVdbeMemSqlJetExceptionpublic void grow(int n,
boolean preserve)
ISqlJetVdbeMemgrow in interface ISqlJetVdbeMempublic void nulTerminate()
ISqlJetVdbeMemnulTerminate in interface ISqlJetVdbeMempublic void changeEncoding(SqlJetEncoding desiredEnc) throws SqlJetException
ISqlJetVdbeMemchangeEncoding in interface ISqlJetVdbeMemSqlJetExceptionpublic void translate(SqlJetEncoding desiredEnc) throws SqlJetException
ISqlJetVdbeMemtranslate in interface ISqlJetVdbeMemSqlJetExceptionpublic void expandBlob()
ISqlJetVdbeMemexpandBlob in interface ISqlJetVdbeMempublic void fromBtree(ISqlJetBtreeCursor pCur, int offset, int amt, boolean key) throws SqlJetException
ISqlJetVdbeMemfromBtree in interface ISqlJetVdbeMemoffset - Offset from the start of data to return bytes from.amt - Number of bytes to return.key - If true, retrieve from the btree key, not data.SqlJetExceptionpublic void makeWriteable()
ISqlJetVdbeMemmakeWriteable in interface ISqlJetVdbeMempublic long intValue()
ISqlJetVdbeMemintValue in interface ISqlJetVdbeMempublic void setNull()
ISqlJetVdbeMemsetNull in interface ISqlJetVdbeMempublic void setStr(ISqlJetMemoryPointer z, SqlJetEncoding enc) throws SqlJetException
ISqlJetVdbeMemsetStr in interface ISqlJetVdbeMemSqlJetExceptionpublic void setInt64(long val)
ISqlJetVdbeMemsetInt64 in interface ISqlJetVdbeMempublic double realValue()
ISqlJetVdbeMemrealValue in interface ISqlJetVdbeMempublic void integerAffinity()
ISqlJetVdbeMemintegerAffinity in interface ISqlJetVdbeMempublic void integerify()
ISqlJetVdbeMemintegerify in interface ISqlJetVdbeMempublic void realify()
ISqlJetVdbeMemrealify in interface ISqlJetVdbeMempublic void numerify()
ISqlJetVdbeMemnumerify in interface ISqlJetVdbeMempublic void setTypeFlag(SqlJetVdbeMemFlags f)
ISqlJetVdbeMemsetTypeFlag in interface ISqlJetVdbeMempublic void setZeroBlob(int n)
ISqlJetVdbeMemsetZeroBlob in interface ISqlJetVdbeMempublic void setDouble(double val)
ISqlJetVdbeMemsetDouble in interface ISqlJetVdbeMempublic void setRowSet()
ISqlJetVdbeMemsetRowSet in interface ISqlJetVdbeMempublic boolean isTooBig()
ISqlJetVdbeMemisTooBig in interface ISqlJetVdbeMempublic void sanity()
ISqlJetVdbeMemsanity in interface ISqlJetVdbeMempublic int valueBytes(SqlJetEncoding enc) throws SqlJetException
ISqlJetVdbeMemvalueBytes in interface ISqlJetVdbeMemSqlJetExceptionpublic void handleBom()
ISqlJetVdbeMemhandleBom in interface ISqlJetVdbeMempublic java.util.Set<SqlJetVdbeMemFlags> getFlags()
getFlags in interface ISqlJetVdbeMempublic boolean isNull()
isNull in interface ISqlJetVdbeMempublic SqlJetValueType getType()
getType in interface ISqlJetVdbeMempublic ISqlJetMemoryPointer valueBlob() throws SqlJetException
ISqlJetVdbeMemvalueBlob in interface ISqlJetVdbeMemSqlJetExceptionpublic void applyAffinity(SqlJetTypeAffinity affinity, SqlJetEncoding enc) throws SqlJetException
|
|
| Try to convert value to an integer representation or a floating-point representation if an integer representation is not possible. Note that the integer representation is always preferred, even if the affinity is REAL, because an integer representation is more space efficient on disk. | |
|
|
| Convert value to a text representation. | |
|
|
| No-op. value is unchanged. |
applyAffinity in interface ISqlJetVdbeMemaffinity - The affinity to be appliedenc - Use this text encodingSqlJetExceptionpublic void applyNumericAffinity()
throws SqlJetException
SqlJetException