|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.derby.iapi.types.DataType
org.apache.derby.iapi.types.SQLChar
SQLChar satisfies the DataValueDescriptor interfaces (i.e., OrderableDataType). It implements an String holder, e.g. for storing a column value; it can be specified when constructed to not allow nulls. Nullability cannot be changed after construction.
Because OrderableDataType is a subclass of DataType, SQLChar can play a role in either a DataType/ValueRow or a OrderableDataType/KeyRow, interchangeably.
| Field Summary | |
(package private) char[][] |
arg_passer
|
private static int |
BASE_MEMORY_USAGE
|
private static char[] |
BLANKS
Static array that can be used for blank padding. |
private java.text.CollationKey |
cKey
|
private static int |
GROWBY_FOR_CHAR
when we know that the array needs to grow by at least one byte, it is not performant to grow by just one byte instead this amount is used to provide a reasonable growby size. |
private int[] |
intArray
|
private int |
intLength
|
private LocaleFinder |
localeFinder
|
private char[] |
rawData
|
private int |
rawLength
|
protected static int |
RETURN_SPACE_THRESHOLD
threshold, that decides when we return space back to the VM see getString() where it is used |
protected java.io.InputStream |
stream
|
private java.lang.String |
value
|
| Fields inherited from interface org.apache.derby.iapi.types.StringDataValue |
BOTH, LEADING, TRAILING |
| Fields inherited from interface org.apache.derby.iapi.types.Orderable |
ORDER_OP_EQUALS, ORDER_OP_GREATEROREQUALS, ORDER_OP_GREATERTHAN, ORDER_OP_LESSOREQUALS, ORDER_OP_LESSTHAN |
| Fields inherited from interface org.apache.derby.iapi.types.VariableSizeDataValue |
IGNORE_PRECISION |
| Constructor Summary | |
SQLChar()
no-arg constructor, required by Formattable. |
|
SQLChar(java.lang.String val)
|
|
| Method Summary | |
static void |
appendBlanks(char[] ca,
int offset,
int howMany)
|
NumberDataValue |
charLength(NumberDataValue result)
This method implements the char_length function for char. |
java.lang.Object |
cloneObject()
From CloneableObject Shallow clone a StreamStorable without objectifying. |
int |
compare(DataValueDescriptor other)
Compare this Orderable with a given Orderable for the purpose of index positioning. |
boolean |
compare(int op,
DataValueDescriptor other,
boolean orderedNulls,
boolean unknownRV)
Compare this Orderable with a given Orderable for the purpose of qualification and sorting. |
StringDataValue |
concatenate(StringDataValue leftOperand,
StringDataValue rightOperand,
StringDataValue result)
The SQL concatenation '||' operator. |
protected void |
copyState(SQLChar other)
|
BooleanDataValue |
equals(DataValueDescriptor left,
DataValueDescriptor right)
The = operator as called from the language module, as opposed to the storage module. |
int |
estimateMemoryUsage()
Estimate the memory usage in bytes of the data value and the overhead of the class. |
private void |
formatJDBCDate(java.util.Calendar cal,
java.lang.StringBuffer sb)
|
private void |
formatJDBCTime(java.util.Calendar cal,
java.lang.StringBuffer sb)
|
boolean |
getBoolean()
Gets the value in the data value descriptor as a boolean. |
byte |
getByte()
Gets the value in the data value descriptor as a byte. |
char[] |
getCharArray()
Get a char array. |
DataValueDescriptor |
getClone()
Clone this DataValueDescriptor. |
protected java.text.CollationKey |
getCollationKey()
|
java.sql.Date |
getDate(java.util.Calendar cal)
Gets the value in the data value descriptor as a java.sql.Date. |
static java.sql.Date |
getDate(java.util.Calendar cal,
java.lang.String str,
LocaleFinder localeFinder)
|
protected java.text.DateFormat |
getDateFormat()
|
protected java.text.DateFormat |
getDateFormat(java.util.Calendar cal)
|
double |
getDouble()
Gets the value in the data value descriptor as a double. |
float |
getFloat()
Gets the value in the data value descriptor as a float. |
int |
getInt()
Gets the value in the data value descriptor as an int. |
private int[] |
getIntArray()
|
private int |
getIntLength()
|
int |
getLength()
Gets the length of the data value. |
private java.util.Locale |
getLocale()
|
protected LocaleFinder |
getLocaleFinder()
|
long |
getLong()
Gets the value in the data value descriptor as a long. |
DataValueDescriptor |
getNewNull()
Get a new null value of the same type as this data value. |
protected StringDataValue |
getNewVarchar()
Get a SQLVarchar for a built-in string function. |
java.lang.Object |
getObject()
Gets the value in the data value descriptor as a Java Object. |
short |
getShort()
Gets the value in the data value descriptor as a short. |
java.io.InputStream |
getStream()
Gets the value in the data value descriptor as a Java InputStream. |
java.lang.String |
getString()
If possible, use getCharArray() if you don't really need a string. |
java.sql.Time |
getTime(java.util.Calendar cal)
Gets the value in the data value descriptor as a java.sql.Time. |
static java.sql.Time |
getTime(java.util.Calendar cal,
java.lang.String str,
LocaleFinder localeFinder)
|
protected java.text.DateFormat |
getTimeFormat()
|
protected java.text.DateFormat |
getTimeFormat(java.util.Calendar cal)
|
java.sql.Timestamp |
getTimestamp(java.util.Calendar cal)
Gets the value in the data value descriptor as a java.sql.Timestamp. |
static java.sql.Timestamp |
getTimestamp(java.util.Calendar cal,
java.lang.String str,
LocaleFinder localeFinder)
|
protected java.text.DateFormat |
getTimestampFormat()
|
protected java.text.DateFormat |
getTimestampFormat(java.util.Calendar cal)
|
int |
getTypeFormatId()
Return my format identifier. |
java.lang.String |
getTypeName()
Get the SQL name of the datatype |
BooleanDataValue |
greaterOrEquals(DataValueDescriptor left,
DataValueDescriptor right)
The >= operator as called from the language module, as opposed to the storage module. |
BooleanDataValue |
greaterThan(DataValueDescriptor left,
DataValueDescriptor right)
The > operator as called from the language module, as opposed to the storage module. |
protected int |
growBy()
returns the reasonable minimum amount by which the array can grow . |
int |
hashCode()
|
protected void |
hasNonBlankChars(java.lang.String source,
int start,
int end)
|
protected boolean |
isNationalString()
Return whether or not this is a national character datatype. |
boolean |
isNull()
see if the String value is null. |
BooleanDataValue |
lessOrEquals(DataValueDescriptor left,
DataValueDescriptor right)
The <= operator as called from the language module, as opposed to the storage module. |
BooleanDataValue |
lessThan(DataValueDescriptor left,
DataValueDescriptor right)
The < operator as called from the language module, as opposed to the storage module. |
BooleanDataValue |
like(DataValueDescriptor pattern)
This method implements the like function for char (with no escape value). |
BooleanDataValue |
like(DataValueDescriptor pattern,
DataValueDescriptor escape)
This method implements the like function for char with an escape value. |
void |
loadStream()
sets the stream state for the object. |
NumberDataValue |
locate(StringDataValue searchFrom,
NumberDataValue start,
NumberDataValue result)
This method implements the locate function for char. |
StringDataValue |
lower(StringDataValue result)
Convert the string to lower case. |
protected java.sql.Date |
nationalGetDate(java.util.Calendar cal)
This implements getDate() for the national types. |
protected java.sql.Time |
nationalGetTime(java.util.Calendar cal)
This implements getTime() for the national types. |
protected java.sql.Timestamp |
nationalGetTimestamp(java.util.Calendar cal)
This implements getTimestamp() for the national types. |
protected int |
nationalHashCode()
Implementation of hashCode() for the national character types, put here to make it accessible to all the national types. |
void |
normalize(DataTypeDescriptor desiredType,
DataValueDescriptor source)
Normalization method - this method may be called when putting a value into a SQLChar, for example, when inserting into a SQLChar column. |
protected void |
normalize(DataTypeDescriptor desiredType,
java.lang.String sourceValue)
|
BooleanDataValue |
notEquals(DataValueDescriptor left,
DataValueDescriptor right)
The <> operator as called from the language module, as opposed to the storage module. |
void |
readExternal(java.io.ObjectInput in)
|
void |
readExternalFromArray(ArrayInputStream in)
Reads in a string from the specified data input stream. |
void |
restoreToNull()
Restore this object to its (SQL)null value. |
java.io.InputStream |
returnStream()
Return the stream state of the object. |
private void |
setAsToNationalString(java.lang.Object theValue)
|
void |
setBigDecimal(java.lang.Number bigDecimal)
Only to be called when an application through JDBC is setting a SQLChar to a java.math.BigDecimal. |
private java.text.DateFormat |
setDateFormatCalendar(java.text.DateFormat df,
java.util.Calendar cal)
|
protected void |
setFrom(DataValueDescriptor theValue)
|
void |
setInto(java.sql.PreparedStatement ps,
int position)
Set the value into a PreparedStatement. |
protected void |
setLocaleFinder(LocaleFinder localeFinder)
|
void |
setStream(java.io.InputStream newStream)
sets the stream state for the object. |
void |
setValue(boolean theValue)
Set the value. |
void |
setValue(byte theValue)
Set the value of this DataValueDescriptor to the given byte value |
void |
setValue(byte[] theValue)
Set the value of this DataValueDescriptor. |
void |
setValue(java.sql.Date theValue,
java.util.Calendar cal)
Set the value of this DataValueDescriptor. |
void |
setValue(double theValue)
Set the value of this DataValueDescriptor to the given double value |
void |
setValue(float theValue)
Set the value of this DataValueDescriptor to the given double value |
void |
setValue(java.io.InputStream theStream,
int streamLength)
Set the value to be the contents of the stream. |
void |
setValue(int theValue)
Set the value of this DataValueDescriptor to the given int value |
void |
setValue(long theValue)
Set the value of this DataValueDescriptor to the given long value |
void |
setValue(java.lang.Object theValue)
Set the value of this DataValueDescriptor to the given value |
void |
setValue(short theValue)
Set the value of this DataValueDescriptor to the given short value |
void |
setValue(java.lang.String theValue)
Set the value of this DataValueDescriptor. |
void |
setValue(java.sql.Time theValue,
java.util.Calendar cal)
Set the value of this DataValueDescriptor. |
void |
setValue(java.sql.Timestamp theValue,
java.util.Calendar cal)
Set the value of this DataValueDescriptor. |
void |
setValueFromResultSet(java.sql.ResultSet resultSet,
int colNumber,
boolean isNullable)
Set the value based on the value for the specified DataValueDescriptor from the specified ResultSet. |
DataValueDescriptor |
setWidth(int desiredWidth,
int desiredScale,
boolean errorOnTrunc)
Set the width of the to the desired value. |
protected int |
stringCollatorCompare(SQLChar str2)
Compare a localized string with this one. |
protected static int |
stringCompare(char[] op1,
int leftlen,
char[] op2,
int rightlen)
Compare two Strings using standard SQL semantics. |
protected int |
stringCompare(SQLChar char1,
SQLChar char2)
Compare two SQLChars. |
protected static int |
stringCompare(java.lang.String op1,
java.lang.String op2)
Compare two Strings using standard SQL semantics. |
ConcatableDataValue |
substring(NumberDataValue start,
NumberDataValue length,
ConcatableDataValue result,
int maxLen)
The SQL substr() function. |
java.lang.String |
toString()
|
StringDataValue |
trim(int trimType,
StringDataValue result)
The SQL trim(), ltrim() and rtrim() functions. |
int |
typePrecedence()
Each built-in type in JSQL has a precedence. |
int |
typeToBigDecimal()
CHAR/VARCHAR/LONG VARCHAR implementation. |
StringDataValue |
upper(StringDataValue result)
Convert the string to upper case. |
void |
writeExternal(java.io.ObjectOutput out)
The maximum stored size is based upon the UTF format used to stored the String. |
XMLDataValue |
XMLParse(XMLDataValue result,
boolean preserveWS)
|
| Methods inherited from class org.apache.derby.iapi.types.DataType |
checkHostVariable, coalesce, dataTypeConversion, equals, flip, genericSetObject, getBytes, getNationalString, in, invalidFormat, isNotNull, isNullOp, outOfRange, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, throwLangSetMismatch, throwLangSetMismatch |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.types.DataValueDescriptor |
checkHostVariable, coalesce, getBytes, in, isNotNull, isNullOp, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue |
| Field Detail |
protected static final int RETURN_SPACE_THRESHOLD
private static final int GROWBY_FOR_CHAR
private static final char[] BLANKS
char[][] arg_passer
private java.lang.String value
private char[] rawData
private int rawLength
private java.text.CollationKey cKey
protected java.io.InputStream stream
private int[] intArray
private int intLength
private LocaleFinder localeFinder
private static final int BASE_MEMORY_USAGE
| Constructor Detail |
public SQLChar()
public SQLChar(java.lang.String val)
| Method Detail |
public static void appendBlanks(char[] ca,
int offset,
int howMany)
public boolean getBoolean()
throws StandardException
DataValueDescriptor
getBoolean in interface DataValueDescriptorgetBoolean in class DataTypeStandardException - Thrown on errorDataValueDescriptor.getBoolean()
public byte getByte()
throws StandardException
DataValueDescriptor
getByte in interface DataValueDescriptorgetByte in class DataTypeStandardException - thrown on failure to convertDataValueDescriptor.getByte()
public short getShort()
throws StandardException
DataValueDescriptor
getShort in interface DataValueDescriptorgetShort in class DataTypeStandardException - thrown on failure to convertDataValueDescriptor.getShort()
public int getInt()
throws StandardException
DataValueDescriptor
getInt in interface DataValueDescriptorgetInt in class DataTypeStandardException - thrown on failure to convertDataValueDescriptor.getInt()
public long getLong()
throws StandardException
DataValueDescriptor
getLong in interface DataValueDescriptorgetLong in class DataTypeStandardException - thrown on failure to convertDataValueDescriptor.getLong()
public float getFloat()
throws StandardException
DataValueDescriptor
getFloat in interface DataValueDescriptorgetFloat in class DataTypeStandardException - thrown on failure to convertDataValueDescriptor.getFloat()
public double getDouble()
throws StandardException
DataValueDescriptor
getDouble in interface DataValueDescriptorgetDouble in class DataTypeStandardException - thrown on failure to convertDataValueDescriptor.getDouble()
public int typeToBigDecimal()
throws StandardException
typeToBigDecimal in interface DataValueDescriptortypeToBigDecimal in class DataTypeStandardException
public java.sql.Date getDate(java.util.Calendar cal)
throws StandardException
DataValueDescriptor
getDate in interface DataValueDescriptorgetDate in class DataTypecal - calendar for object creation
StandardException - thrown on failure to convertDataValueDescriptor.getDate(java.util.Calendar)
public static java.sql.Date getDate(java.util.Calendar cal,
java.lang.String str,
LocaleFinder localeFinder)
throws StandardException
StandardException
public java.sql.Time getTime(java.util.Calendar cal)
throws StandardException
DataValueDescriptor
getTime in interface DataValueDescriptorgetTime in class DataTypecal - calendar for object creation
StandardException - thrown on failure to convertDataValueDescriptor.getTime(java.util.Calendar)
public static java.sql.Time getTime(java.util.Calendar cal,
java.lang.String str,
LocaleFinder localeFinder)
throws StandardException
StandardException - thrown on failure to convert
public java.sql.Timestamp getTimestamp(java.util.Calendar cal)
throws StandardException
DataValueDescriptor
getTimestamp in interface DataValueDescriptorgetTimestamp in class DataTypecal - calendar for object creation
StandardException - thrown on failure to convertDataValueDescriptor.getTimestamp(java.util.Calendar)
public static java.sql.Timestamp getTimestamp(java.util.Calendar cal,
java.lang.String str,
LocaleFinder localeFinder)
throws StandardException
StandardException - thrown on failure to convertDataValueDescriptor.getTimestamp(java.util.Calendar)
public java.lang.Object getObject()
throws StandardException
DataValueDescriptor
getObject in interface DataValueDescriptorgetObject in class DataTypeStandardException - Thrown on error
public java.io.InputStream getStream()
throws StandardException
DataValueDescriptor
getStream in interface DataValueDescriptorgetStream in class DataTypeStandardException - Thrown on error
public int getLength()
throws StandardException
DataValueDescriptor
getLength in interface DataValueDescriptorStandardException - Thrown on errorpublic java.lang.String getTypeName()
DataValueDescriptor
getTypeName in interface DataValueDescriptor
public java.lang.String getString()
throws StandardException
getString in interface DataValueDescriptorStandardException - Thrown on error
public char[] getCharArray()
throws StandardException
WARNING: may return a character array that has spare characters at the end. MUST be used in conjunction with getLength() to be safe.
getCharArray in interface StringDataValueStandardException - Thrown on errorpublic java.io.InputStream returnStream()
StreamStorable
returnStream in interface StreamStorablepublic void setStream(java.io.InputStream newStream)
StreamStorable
setStream in interface StreamStorable
public void loadStream()
throws StandardException
StreamStorable
loadStream in interface StreamStorableStandardException - on errorpublic int getTypeFormatId()
getTypeFormatId in interface TypedFormatTypedFormat.getTypeFormatId()public boolean isNull()
isNull in interface StorableStorable.isNull()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
First, two bytes are written to the output stream as if by the
writeShort method giving the number of bytes to
follow. This value is the number of bytes actually written out,
not the length of the string. Following the length, each character
of the string is output, in sequence, using the UTF-8 encoding
for the character.
writeExternal in interface java.io.Externalizablejava.io.IOException - if an I/O error occurs.
java.io.IOException - thrown by writeUTFDataInputStream
public void readExternalFromArray(ArrayInputStream in)
throws java.io.IOException
The first two bytes are read as if by
readUnsignedShort. This value gives the number of
following bytes that are in the encoded string, not
the length of the resulting string. The following bytes are then
interpreted as bytes encoding characters in the UTF-8 format
and are converted into characters.
This method blocks until all the bytes are read, the end of the stream is detected, or an exception is thrown.
readExternalFromArray in interface DataValueDescriptorin - a data input stream.
java.io.EOFException - if the input stream reaches the end
before all the bytes.
java.io.IOException - if an I/O error occurs.
java.io.UTFDataFormatException - if the bytes do not represent a
valid UTF-8 encoding of a Unicode string.DataInputStream.readUnsignedShort(),
Externalizable.readExternal(java.io.ObjectInput)
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal in interface java.io.Externalizablejava.io.IOExceptionprotected int growBy()
public void restoreToNull()
Storable
restoreToNull in interface StorableStorable.restoreToNull()
public boolean compare(int op,
DataValueDescriptor other,
boolean orderedNulls,
boolean unknownRV)
throws StandardException
DataValueDescriptor
compare in interface DataValueDescriptorcompare in class DataTypeStandardException - thrown on error
public int compare(DataValueDescriptor other)
throws StandardException
DataValueDescriptor
compare in interface DataValueDescriptorother - The Orderable to compare this one to.
StandardException - thrown on errorpublic java.lang.Object cloneObject()
cloneObject in interface CloneableObjectcloneObject in class DataTypepublic DataValueDescriptor getClone()
DataValueDescriptor
getClone in interface DataValueDescriptorDataValueDescriptor.getClone()public DataValueDescriptor getNewNull()
DataValueDescriptor
getNewNull in interface DataValueDescriptorDataValueDescriptor.getNewNull()
public final void setValueFromResultSet(java.sql.ResultSet resultSet,
int colNumber,
boolean isNullable)
throws java.sql.SQLException
DataValueDescriptor
setValueFromResultSet in interface DataValueDescriptorresultSet - The specified ResultSet.colNumber - The 1-based column # into the resultSet.isNullable - Whether or not the column is nullable
(No need to call wasNull() if not)
java.sql.SQLException - Thrown on errorDataValueDescriptor.setValueFromResultSet(java.sql.ResultSet, int, boolean)
public final void setInto(java.sql.PreparedStatement ps,
int position)
throws java.sql.SQLException,
StandardException
setInto in interface DataValueDescriptorsetInto in class DataTypejava.sql.SQLException
StandardExceptionpublic void setValue(java.lang.String theValue)
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The BigDecimal value to set this DataValueDescriptor to
public void setValue(boolean theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - Contains the boolean value to set this to
StandardException
public void setValue(int theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The value to set this DataValueDescriptor to
StandardException - Thrown on error
public void setValue(double theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The value to set this DataValueDescriptor to
StandardException - Thrown on error
public void setValue(float theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The value to set this DataValueDescriptor to
StandardException - Thrown on error
public void setValue(short theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The value to set this DataValueDescriptor to
StandardException - Thrown on error
public void setValue(long theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The value to set this DataValueDescriptor to
StandardException - Thrown on error
public void setValue(byte theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The value to set this DataValueDescriptor to
StandardException - Thrown on error
public void setValue(byte[] theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The byte value to set this DataValueDescriptor to
StandardException
public void setBigDecimal(java.lang.Number bigDecimal)
throws StandardException
setBigDecimal in interface DataValueDescriptorsetBigDecimal in class DataTypeStandardException
public void setValue(java.sql.Date theValue,
java.util.Calendar cal)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The Date value to set this DataValueDescriptor tocal - The time zone from the calendar is used to construct the database date value
StandardException - Thrown on error
public void setValue(java.sql.Time theValue,
java.util.Calendar cal)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The Time value to set this DataValueDescriptor tocal - The time zone from the calendar is used to construct the database time value
StandardException - Thrown on error
public void setValue(java.sql.Timestamp theValue,
java.util.Calendar cal)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The Timestamp value to set this DataValueDescriptor tocal - The time zone from the calendar is used to construct the database timestamp value
StandardException - Thrown on error
private void formatJDBCDate(java.util.Calendar cal,
java.lang.StringBuffer sb)
private void formatJDBCTime(java.util.Calendar cal,
java.lang.StringBuffer sb)
public void setValue(java.io.InputStream theStream,
int streamLength)
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypesetValue(java.lang.String)
public void setValue(java.lang.Object theValue)
throws StandardException
DataValueDescriptor
setValue in interface DataValueDescriptorsetValue in class DataTypeStandardExceptionDataValueDescriptor.setValue(java.lang.Object)
protected void setFrom(DataValueDescriptor theValue)
throws StandardException
setFrom in class DataTypeStandardExceptionprivate void setAsToNationalString(java.lang.Object theValue)
public void normalize(DataTypeDescriptor desiredType,
DataValueDescriptor source)
throws StandardException
normalize in interface DataValueDescriptornormalize in class DataTypedesiredType - The type to normalize the source column tosource - The value to normalize
StandardException - Thrown for null into
non-nullable column, and for
truncation error
protected void normalize(DataTypeDescriptor desiredType,
java.lang.String sourceValue)
throws StandardException
StandardException
protected final void hasNonBlankChars(java.lang.String source,
int start,
int end)
throws StandardException
StandardException
public DataValueDescriptor setWidth(int desiredWidth,
int desiredScale,
boolean errorOnTrunc)
throws StandardException
setWidth in interface VariableSizeDataValuedesiredWidth - the desired lengthdesiredScale - the desired scale (ignored)errorOnTrunc - throw an error on truncation
StandardException - Thrown when errorOnTrunc
is true and when a shrink will truncate non-white
spaces.
public BooleanDataValue equals(DataValueDescriptor left,
DataValueDescriptor right)
throws StandardException
equals in interface DataValueDescriptorequals in class DataTypeleft - The value on the left side of the =right - The value on the right side of the =
StandardException - Thrown on error
public BooleanDataValue notEquals(DataValueDescriptor left,
DataValueDescriptor right)
throws StandardException
notEquals in interface DataValueDescriptornotEquals in class DataTypeleft - The value on the left side of the <>right - The value on the right side of the <>
StandardException - Thrown on error
public BooleanDataValue lessThan(DataValueDescriptor left,
DataValueDescriptor right)
throws StandardException
lessThan in interface DataValueDescriptorlessThan in class DataTypeleft - The value on the left side of the <right - The value on the right side of the <
StandardException - Thrown on error
public BooleanDataValue greaterThan(DataValueDescriptor left,
DataValueDescriptor right)
throws StandardException
greaterThan in interface DataValueDescriptorgreaterThan in class DataTypeleft - The value on the left side of the >right - The value on the right side of the >
StandardException - Thrown on error
public BooleanDataValue lessOrEquals(DataValueDescriptor left,
DataValueDescriptor right)
throws StandardException
lessOrEquals in interface DataValueDescriptorlessOrEquals in class DataTypeleft - The value on the left side of the <=right - The value on the right side of the <=
StandardException - Thrown on error
public BooleanDataValue greaterOrEquals(DataValueDescriptor left,
DataValueDescriptor right)
throws StandardException
greaterOrEquals in interface DataValueDescriptorgreaterOrEquals in class DataTypeleft - The value on the left side of the >=right - The value on the right side of the >=
StandardException - Thrown on error
public NumberDataValue charLength(NumberDataValue result)
throws StandardException
charLength in interface ConcatableDataValueresult - The result of a previous call to this method, null
if not called yet
StandardException - Thrown on errorConcatableDataValue.charLength(NumberDataValue)
public StringDataValue concatenate(StringDataValue leftOperand,
StringDataValue rightOperand,
StringDataValue result)
throws StandardException
StringDataValue
concatenate in interface StringDataValueleftOperand - String on the left hand side of '||'rightOperand - String on the right hand side of '||'result - The result of a previous call to this method,
null if not called yet.
StandardException - Thrown on errorStringDataValue.concatenate(org.apache.derby.iapi.types.StringDataValue, org.apache.derby.iapi.types.StringDataValue, org.apache.derby.iapi.types.StringDataValue)
public BooleanDataValue like(DataValueDescriptor pattern)
throws StandardException
like in interface StringDataValuepattern - The pattern to use
StandardException - Thrown on error
public BooleanDataValue like(DataValueDescriptor pattern,
DataValueDescriptor escape)
throws StandardException
like in interface StringDataValuepattern - The pattern to useescape - the escape character
StandardException - Thrown on error
public NumberDataValue locate(StringDataValue searchFrom,
NumberDataValue start,
NumberDataValue result)
throws StandardException
locate in interface StringDataValuesearchFrom - - The string to search fromstart - - The position to search from in string searchFromresult - - The object to return
Note: use getString() to get the string to search for.
StandardException - Thrown on error
public ConcatableDataValue substring(NumberDataValue start,
NumberDataValue length,
ConcatableDataValue result,
int maxLen)
throws StandardException
substring in interface ConcatableDataValuestart - Start of substrlength - Length of substrresult - The result of a previous call to this method,
null if not called yet.maxLen - Maximum length of the result
StandardException - Thrown on error
public StringDataValue trim(int trimType,
StringDataValue result)
throws StandardException
trim in interface StringDataValuetrimType - Type of trimresult - The result of a previous call to this method,
null if not called yet.
StandardException - Thrown on error
public StringDataValue upper(StringDataValue result)
throws StandardException
StringDataValue
upper in interface StringDataValueresult - The result (reusable - allocate if null).
StandardException - Thrown on errorStringDataValue.upper(org.apache.derby.iapi.types.StringDataValue)
public StringDataValue lower(StringDataValue result)
throws StandardException
StringDataValue
lower in interface StringDataValueresult - The result (reusable - allocate if null).
StandardException - Thrown on errorStringDataValue.lower(org.apache.derby.iapi.types.StringDataValue)public int typePrecedence()
DataValueDescriptor
typePrecedence in interface DataValueDescriptortypePrecedence in class DataTypeDataValueDescriptor.typePrecedence()
protected static int stringCompare(java.lang.String op1,
java.lang.String op2)
op1 - The first Stringop2 - The second String
protected int stringCompare(SQLChar char1,
SQLChar char2)
throws StandardException
StandardException - Thrown on error
protected static int stringCompare(char[] op1,
int leftlen,
char[] op2,
int rightlen)
op1 - The first Stringop2 - The second String
protected int stringCollatorCompare(SQLChar str2)
throws StandardException
str2 - The other string
StandardException
protected java.text.CollationKey getCollationKey()
throws StandardException
StandardExceptionpublic java.lang.String toString()
public int hashCode()
protected int nationalHashCode()
private int[] getIntArray()
throws StandardException
StandardExceptionprivate int getIntLength()
protected StringDataValue getNewVarchar()
throws StandardException
StandardException - Thrown on errorprotected boolean isNationalString()
protected java.sql.Date nationalGetDate(java.util.Calendar cal)
throws StandardException
StandardException - thrown on failure to convert
protected java.sql.Time nationalGetTime(java.util.Calendar cal)
throws StandardException
StandardException - thrown on failure to convert
protected java.sql.Timestamp nationalGetTimestamp(java.util.Calendar cal)
throws StandardException
StandardException - thrown on failure to convertprotected void setLocaleFinder(LocaleFinder localeFinder)
private java.util.Locale getLocale()
throws StandardException
StandardException - Thrown on errorprotected LocaleFinder getLocaleFinder()
protected java.text.DateFormat getDateFormat()
throws StandardException
StandardException
protected java.text.DateFormat getTimeFormat()
throws StandardException
StandardException
protected java.text.DateFormat getTimestampFormat()
throws StandardException
StandardException
protected java.text.DateFormat getDateFormat(java.util.Calendar cal)
throws StandardException
StandardException
protected java.text.DateFormat getTimeFormat(java.util.Calendar cal)
throws StandardException
StandardException
protected java.text.DateFormat getTimestampFormat(java.util.Calendar cal)
throws StandardException
StandardException
private java.text.DateFormat setDateFormatCalendar(java.text.DateFormat df,
java.util.Calendar cal)
public int estimateMemoryUsage()
DataValueDescriptor
estimateMemoryUsage in interface DataValueDescriptorprotected void copyState(SQLChar other)
public XMLDataValue XMLParse(XMLDataValue result,
boolean preserveWS)
throws StandardException
XMLParse in interface StringDataValueStandardException
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||