Top Description Fields Constructors Methods
org.apache.derby.iapi.types

public Class SQLChar

extends DataType
implements StringDataValue, StreamStorable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.StreamStorable, org.apache.derby.iapi.types.StringDataValue, org.apache.derby.iapi.types.ConcatableDataValue, org.apache.derby.iapi.types.VariableSizeDataValue, org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.iapi.types.Orderable, org.apache.derby.iapi.services.io.Storable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Known Direct Subclasses
org.apache.derby.iapi.types.SQLVarchar, org.apache.derby.iapi.types.CollatorSQLChar
Imports
org.apache.derby.iapi.services.context.ContextService, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.Storable, .StoredFormatIds, .StreamStorable, .FormatIdInputStream, .FormatIdOutputStream, .ArrayInputStream, .CounterOutputStream, .InputStreamUtil, org.apache.derby.shared.common.reference.ContextId, .SQLState, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.jdbc.CharacterStreamDescriptor, org.apache.derby.iapi.services.cache.ClassSize, org.apache.derby.iapi.util.StringUtil, .UTF8Util, org.apache.derby.shared.common.i18n.LocaleFinder, org.apache.derby.iapi.sql.conn.StatementContext, org.apache.derby.iapi.db.DatabaseContext, java.io.InputStream, .ObjectOutput, .ObjectInput, .IOException, .UTFDataFormatException, .EOFException, .Reader, java.math.BigDecimal, java.sql.Clob, .DataTruncation, .Date, .ResultSet, .PreparedStatement, .SQLException, .Time, .Timestamp, java.text.RuleBasedCollator, .CollationKey, java.util.Arrays, .Locale, .Calendar

The SQLChar represents a CHAR value with UCS_BASIC collation. SQLChar may be used directly by any code when it is guaranteed that the required collation is UCS_BASIC, e.g. system columns.

The state may be in char[], a String, a Clob, or an unread stream, depending on how the datatype was created.

Stream notes:

When the datatype comes from the database layer and the length of the bytes necessary to store the datatype on disk exceeds the size of a page of the container holding the data then the store returns a stream rather than reading all the bytes into a char[] or String. The hope is that the usual usage case is that data never need be expanded in the derby layer, and that client can just be given a stream that can be read a char at a time through the jdbc layer. Even though SQLchar's can't ever be this big, this code is shared by all the various character datatypes including SQLClob which is expected to usually larger than a page.

The state can also be a stream in the case of insert/update where the client has used a jdbc interface to set the value as a stream rather than char[]. In this case the hope is that the usual usage case is that stream never need be read until it is passed to store, read once, and inserted into the database.

Field Summary

Modifier and TypeField and Description
protected Clob
_clobValue

The value as a user-created Clob

pack-priv char[][]
private static final int
private static final char[]
BLANKS

Static array that can be used for blank padding.

protected static final StreamHeaderGenerator
CHAR_HEADER_GENERATOR

Stream header generator for CHAR, VARCHAR and LONG VARCHAR.

private CollationKey
private static final 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 LocaleFinder
private static final char
PAD

The pad character (space).

private char[]
private int
protected static final int
RETURN_SPACE_THRESHOLD

threshold, that decides when we return space back to the VM see getString() where it is used

pack-priv InputStream
stream

The value as a stream in the on-disk format.

private String
value

Fields of the class

Constructor Summary

AccessConstructor and Description
public
SQLChar()

no-arg constructor, required by Formattable.

public
public
public
SQLChar(char[] val)

This is a special constructor used when we need to represent a password as a VARCHAR (see DERBY-866).

Method Summary

Modifier and TypeMethod and Description
public StringDataValue

Returns:

A StringDataValue containing the result of the trim.
ansiTrim
(int
Type of trim (LEADING, TRAILING, or BOTH)
trimType
,
StringDataValue
Character to trim from this SQLChar (may be null)
trimChar
,
StringDataValue
The result of a previous call to this method, null if not called yet.
result
)

Implements org.apache.derby.iapi.types.StringDataValue.ansiTrim.

The SQL Ansi trim function.

private static void
appendBlanks(char[] ca, int offset, int howMany)

Private/Protected methods of This class:

public NumberDataValue

Returns:

A SQLInteger containing the length of the char value
charLength
(NumberDataValue
The result of a previous call to this method, null if not called yet
result
)

Implements org.apache.derby.iapi.types.ConcatableDataValue.charLength.

This method implements the char_length function for char.

public DataValueDescriptor
cloneHolder()

Overrides org.apache.derby.iapi.types.DataType.cloneHolder.

Implements org.apache.derby.iapi.types.DataValueDescriptor.cloneHolder.

Shallow clone a StreamStorable without objectifying.

public DataValueDescriptor
cloneValue(boolean
any streams representing the data value will be materialized if true, the data value will be kept as a stream if possible if false
forceMaterialization
)

Implements org.apache.derby.iapi.types.DataValueDescriptor.cloneValue.

Clone this DataValueDescriptor.

public boolean
compare(int
Orderable.ORDER_OP_EQUALS means do an = comparison. Orderable.ORDER_OP_LESSTHAN means compare this < other. Orderable.ORDER_OP_LESSOREQUALS means compare this <= other.
op
,
DataValueDescriptor
The DataValueDescriptor to compare this one to.
other
,
boolean
True means to treat nulls as ordered values, that is, treat SQL null as equal to null, and less than all other values. False means to treat nulls as unknown values, that is, the result of any comparison with a null is the UNKNOWN truth value.
orderedNulls
,
boolean
The return value to use if the result of the comparison is the UNKNOWN truth value. In other words, if orderedNulls is false, and a null is involved in the comparison, return unknownRV. This parameter is not used orderedNulls is true.
unknownRV
)

Overrides org.apache.derby.iapi.types.DataType.compare.

Implements org.apache.derby.iapi.types.DataValueDescriptor.compare.

Compare this Orderable with a given Orderable for the purpose of qualification and sorting.

public int
compare(DataValueDescriptor
The Orderable to compare this one to.
other
)

Implements org.apache.derby.iapi.types.DataValueDescriptor.compare.

Compare this Orderable with a given Orderable for the purpose of index positioning.

public StringDataValue
concatenate(StringDataValue
String on the left hand side of '||'
leftOperand
,
StringDataValue
String on the right hand side of '||'
rightOperand
,
StringDataValue
The result of a previous call to this method, null if not called yet.
result
)

Implements org.apache.derby.iapi.types.StringDataValue.concatenate.

The SQL concatenation '||' operator.

protected void
private void
copyState(String otherValue, char[] otherRawData, int otherRawLength, CollationKey otherCKey, InputStream otherStream, Clob otherClobValue, LocaleFinder otherLocaleFinder)

public BooleanDataValue

Returns:

A SQL boolean value telling whether the two parameters are equal
equals
(DataValueDescriptor
The value on the left side of the =
left
,
DataValueDescriptor
The value on the right side of the =
right
)

Overrides org.apache.derby.iapi.types.DataType.equals.

Implements org.apache.derby.iapi.types.DataValueDescriptor.equals.

The = operator as called from the language module, as opposed to the storage module.

public int
estimateMemoryUsage()

Implements org.apache.derby.iapi.types.DataValueDescriptor.estimateMemoryUsage.

Estimate the memory usage in bytes of the data value and the overhead of the class.

private void
private void
public boolean
public byte
public char[]
private int
protected CollationKey

Returns:

CollationKey obtained using Collator on the string
getCollationKey
()

This method gets called for the collation sensitive char classes ie CollatorSQLChar, CollatorSQLVarchar, CollatorSQLLongvarchar, CollatorSQLClob.

protected RuleBasedCollator
public Date
getDate(Calendar
calendar for object creation
cal
)

Overrides org.apache.derby.iapi.types.DataType.getDate.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getDate.

Get date from a SQLChar.

public static Date
getDate(Calendar cal, String str, LocaleFinder localeFinder)

Static function to Get date from a string.

public double
public float
public int
public int
getLength()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getLength.

Gets the length of the data value.

private Locale
protected LocaleFinder
public long
public DataValueDescriptor
getNewNull()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getNewNull.

Get a new null value of the same type as this data value.

protected StringDataValue

Returns:

a SQLVarchar.
getNewVarchar
()

Get a SQLVarchar for a built-in string function.

public Object
getObject()

Overrides org.apache.derby.iapi.types.DataType.getObject.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getObject.

Gets the value in the data value descriptor as a Java Object.

public char[]
getRawDataAndZeroIt()

This is a special accessor used when we wrap passwords in VARCHARs.

public short
public InputStream
getStream()

Overrides org.apache.derby.iapi.types.DataType.getStream.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getStream.

Gets the value in the data value descriptor as a stream of bytes.

public StreamHeaderGenerator

Returns:

A stream header generator.
getStreamHeaderGenerator
()

Implements org.apache.derby.iapi.types.StringDataValue.getStreamHeaderGenerator.

Returns the default stream header generator for the string data types.

public CharacterStreamDescriptor

Returns:

Nothing, throws exception.
getStreamWithDescriptor
()

Implements org.apache.derby.iapi.types.StringDataValue.getStreamWithDescriptor.

Returns a descriptor for the input stream for this character data value.

public String
getString()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getString.

If possible, use getCharArray() if you don't really need a string.

public Time
getTime(Calendar
calendar for object creation
cal
)

Overrides org.apache.derby.iapi.types.DataType.getTime.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTime.

Get time from a SQLChar.

public static Time
getTime(Calendar cal, String str, LocaleFinder localeFinder)

Static function to Get Time from a string.

public Timestamp
getTimestamp(Calendar
calendar for object creation
cal
)

Overrides org.apache.derby.iapi.types.DataType.getTimestamp.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTimestamp.

Get Timestamp from a SQLChar.

public static Timestamp
getTimestamp(Calendar cal, String str, LocaleFinder localeFinder)

Static function to Get Timestamp from a string.

public String

Returns:

a trace representation of this SQL Type.
getTraceString
()

Overrides org.apache.derby.iapi.types.DataType.getTraceString.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTraceString.

Gets a trace representation for debugging.

public int
public String
getTypeName()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTypeName.

Get the SQL name of the datatype

private int
getUTF8Length(String
the string whose length to calculate
string
,
int
start index (inclusive)
start
,
int
end index (exclusive)
end
)

Get the number of bytes needed to represent a string in modified UTF-8, which is the encoding used by writeExternal() and writeUTF().

public StringDataValue
getValue(RuleBasedCollator collatorForComparison)

Implements org.apache.derby.iapi.types.StringDataValue.getValue.

Gets either SQLChar/SQLVarchar/SQLLongvarchar/SQLClob(base classes) or CollatorSQLChar/CollatorSQLVarchar/CollatorSQLLongvarch/CollatorSQLClob (subclasses).

public BooleanDataValue

Returns:

A SQL boolean value telling whether the first operand is greater than or equal to the second operand
greaterOrEquals
(DataValueDescriptor
The value on the left side of the operator
left
,
DataValueDescriptor
The value on the right side of the operator
right
)

Overrides org.apache.derby.iapi.types.DataType.greaterOrEquals.

Implements org.apache.derby.iapi.types.DataValueDescriptor.greaterOrEquals.

The >= operator as called from the language module, as opposed to the storage module.

public BooleanDataValue

Returns:

A SQL boolean value telling whether the first operand is greater than the second operand
greaterThan
(DataValueDescriptor
The value on the left side of the operator
left
,
DataValueDescriptor
The value on the right side of the operator
right
)

Overrides org.apache.derby.iapi.types.DataType.greaterThan.

Implements org.apache.derby.iapi.types.DataValueDescriptor.greaterThan.

The > operator as called from the language module, as opposed to the storage module.

protected int

Returns:

minimum reasonable growby size
growBy
()

returns the reasonable minimum amount by which the array can grow .

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

pack-priv int
hashCodeForCollation()

Hash code implementation for collator sensitive subclasses.

protected final void
hasNonBlankChars(String source, int start, int end)

public boolean
isNull()

Implements org.apache.derby.iapi.services.io.Storable.isNull.

see if the String value is null.

public BooleanDataValue

Returns:

A SQL boolean value telling whether the first operand is less than or equal to the second operand
lessOrEquals
(DataValueDescriptor
The value on the left side of the operator
left
,
DataValueDescriptor
The value on the right side of the operator
right
)

Overrides org.apache.derby.iapi.types.DataType.lessOrEquals.

Implements org.apache.derby.iapi.types.DataValueDescriptor.lessOrEquals.

The <= operator as called from the language module, as opposed to the storage module.

public BooleanDataValue

Returns:

A SQL boolean value telling whether the first operand is less than the second operand
lessThan
(DataValueDescriptor
The value on the left side of the operator
left
,
DataValueDescriptor
The value on the right side of the operator
right
)

Overrides org.apache.derby.iapi.types.DataType.lessThan.

Implements org.apache.derby.iapi.types.DataValueDescriptor.lessThan.

The < operator as called from the language module, as opposed to the storage module.

public BooleanDataValue

Returns:

A SQL boolean value telling whether the first operand is like the second operand
like
(DataValueDescriptor
The pattern to use
pattern
)

Implements org.apache.derby.iapi.types.StringDataValue.like.

This method implements the like function for char (with no escape value).

public BooleanDataValue

Returns:

A SQL boolean value telling whether the first operand is like the second operand
like
(DataValueDescriptor
The pattern to use
pattern
,
DataValueDescriptor
the escape character
escape
)

Implements org.apache.derby.iapi.types.StringDataValue.like.

This method implements the like function for char with an escape value.

public void
loadStream()

Implements org.apache.derby.iapi.services.io.StreamStorable.loadStream.

Set the value by reading the stream and converting it to an object form.

public NumberDataValue

Returns:

The position in searchFrom the fist occurrence of this.value. 0 is returned if searchFrom does not contain this.value.
locate
(StringDataValue
- The string to search from
searchFrom
,
NumberDataValue
- The position to search from in string searchFrom
start
,
NumberDataValue
- The object to return Note: use getString() to get the string to search for.
result
)

Implements org.apache.derby.iapi.types.StringDataValue.locate.

This method implements the locate function for char.

public StringDataValue
lower(StringDataValue
The result (reusable - allocate if null).
result
)

Implements org.apache.derby.iapi.types.StringDataValue.lower.

Convert the string to lower case.

public void
normalize(DataTypeDescriptor
The type to normalize the source column to
desiredType
,
DataValueDescriptor
The value to normalize
source
)

Overrides org.apache.derby.iapi.types.DataType.normalize.

Implements org.apache.derby.iapi.types.DataValueDescriptor.normalize.

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, String sourceValue)

public BooleanDataValue

Returns:

A SQL boolean value telling whether the two parameters are not equal
notEquals
(DataValueDescriptor
The value on the left side of the operator
left
,
DataValueDescriptor
The value on the right side of the operator
right
)

Overrides org.apache.derby.iapi.types.DataType.notEquals.

Implements org.apache.derby.iapi.types.DataValueDescriptor.notEquals.

The <> operator as called from the language module, as opposed to the storage module.

private int
public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

protected void
readExternal(ObjectInput
the source stream
in
,
int
the byte length, or 0 if unknown
utflen
,
final int
the char length, or 0 if unknown
knownStrLen
)

Restores the data value from the source stream, materializing the value in memory.

protected void
readExternalClobFromArray(ArrayInputStream
source stream
in
,
int
the char length of the value, or 0 if unknown
charLen
)

Reads a CLOB from the source stream and materializes the value in a character array.

public void
private void
resetForMaterialization()

Resets state after materializing value from an array.

public void
restoreToNull()

Implements org.apache.derby.iapi.services.io.Storable.restoreToNull.

Restore this object to its (SQL)null value.

public InputStream
returnStream()

Implements org.apache.derby.iapi.services.io.StreamStorable.returnStream.

Public Methods of StreamStorable interface:

public void
setBigDecimal(BigDecimal
required to be a BigDecimal or null.
bigDecimal
)

Overrides org.apache.derby.iapi.types.DataType.setBigDecimal.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setBigDecimal.

Only to be called when an application through JDBC is setting a SQLChar to a java.math.BigDecimal.

protected void
setFrom(DataValueDescriptor
The DataValueDescriptor that holds the value to which we want to set this DataValueDescriptor's value.
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setFrom.

Set the value of this DataValueDescriptor based on the value of the specified DataValueDescriptor.

public final void
setInto(PreparedStatement ps, int position)

Overrides org.apache.derby.iapi.types.DataType.setInto.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setInto.

Set the value into a PreparedStatement.

protected void
public void
setObjectForCast(Object
The new value
theValue
,
boolean
Whether or not the new value is an instanceof the result type.
instanceOfResultType
,
String
The class name of the resulting (declared) type (for error messages only).
resultTypeClassName
)

Overrides org.apache.derby.iapi.types.DataType.setObjectForCast.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setObjectForCast.

Allow any Java type to be cast to a character type using Object.toString.

public void
setStream(InputStream
The new stream to use
newStream
)

Implements org.apache.derby.iapi.services.io.StreamStorable.setStream.

Set this value to the on-disk format stream.

public void
setStreamHeaderFormat(Boolean
true if the database is being accessed in soft upgrade mode, false if not, and null if unknown
inSoftUpgradeMode
)

Implements org.apache.derby.iapi.types.StringDataValue.setStreamHeaderFormat.

Sets the mode for the database being accessed.

public void
setValue(Clob
The Clob value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.StringDataValue.setValue, org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Stuff a StringDataValue with a Clob.

public void
setValue(String
The String value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public void
setValue(boolean
Contains the boolean value to set this to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value.

public void
setValue(int
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given int value

public void
setValue(double
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given double value

public void
setValue(float
A Double containing the value to set this DataValueDescriptor to. Null means set the value to SQL null.
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given double value

public void
setValue(short
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given short value

public void
setValue(long
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given long value

public void
setValue(byte
The value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given byte value

public void
setValue(byte[]
The byte value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public void
setValue(Date
The Date value to set this DataValueDescriptor to
theValue
,
Calendar
The time zone from the calendar is used to construct the database date value
cal
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public void
setValue(Time
The Time value to set this DataValueDescriptor to
theValue
,
Calendar
The time zone from the calendar is used to construct the database time value
cal
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public void
setValue(Timestamp
The Timestamp value to set this DataValueDescriptor to
theValue
,
Calendar
The time zone from the calendar is used to construct the database timestamp value
cal
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

public final void
setValue(InputStream
On disk format of the stream
theStream
,
int
length of the logical value in characters, or DataValueDescriptor.UNKNOWN_LOGICAL_LENGTH
valueLength
)

Overrides org.apache.derby.iapi.types.DataType.setValue.

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value from the stream which is in the on-disk format.

public final void
setValueFromResultSet(ResultSet
The specified ResultSet.
resultSet
,
int
The 1-based column # into the resultSet.
colNumber
,
boolean
Whether or not the column is nullable (No need to call wasNull() if not)
isNullable
)

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValueFromResultSet.

Set the value based on the value for the specified DataValueDescriptor from the specified ResultSet.

public void
setWidth(int
the desired length
desiredWidth
,
int
the desired scale (ignored)
desiredScale
,
boolean
throw an error on truncation
errorOnTrunc
)

Implements org.apache.derby.iapi.types.VariableSizeDataValue.setWidth.

Set the width of the to the desired value.

protected static int

Returns:

-1 - op1 < op2 0 - op1 == op2 1 - op1 > op2
stringCompare
(String
The first String
op1
,
String
The second String
op2
)

Compare two Strings using standard SQL semantics.

protected int
stringCompare(SQLChar char1, SQLChar char2)

Compare two SQLChars.

protected static int

Returns:

-1 - op1 < op2 0 - op1 == op2 1 - op1 > op2
stringCompare
(char[]
The first String
op1
,
int leftlen, char[]
The second String
op2
,
int rightlen)

Compare two Strings using standard SQL semantics.

public ConcatableDataValue

Returns:

A ConcatableDataValue containing the result of the substr()
substring
(NumberDataValue
Start of substr
start
,
NumberDataValue
Length of substr
length
,
ConcatableDataValue
The result of a previous call to this method, null if not called yet.
result
,
int
Maximum length of the result
maxLen
)

Implements org.apache.derby.iapi.types.ConcatableDataValue.substring.

The SQL substr() function.

protected void
throwStreamingIOException(IOException
the IOException to wrap
ioe
)

Wraps an IOException in a StandardException then throws the wrapping exception.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

private String

Returns:

A String containing the result of the trim.
trimInternal
(int
Type of trim (LEADING, TRAILING, or BOTH)
trimType
,
char
Character to trim
trimChar
,
String
String from which to trim trimChar
source
)

This function public for testing purposes.

public int
public int
public StringDataValue
upper(StringDataValue
The result (reusable - allocate if null).
result
)

Implements org.apache.derby.iapi.types.StringDataValue.upper.

Convert the string to upper case.

protected final void
writeClobUTF(ObjectOutput
destination stream
out
)

Writes the header and the user data for a CLOB to the destination stream.

public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

Writes a non-Clob data value to the modified UTF-8 format used by Derby.

private final void
writeUTF(ObjectOutput
destination stream
out
,
int
string length of the value
strLen
,
final boolean
true if the source is rawData, false if the source is value
isRaw
,
Reader
Reader from _clobValue if it exists
characterReader
)

Writes the user data value to a stream in the modified UTF-8 format.

private static void
writeUTF(ObjectOutput
the destination stream
out
,
int
the character to write
c
)

Write a single character to a stream in the modified UTF-8 format.

public void
zeroRawData()

Zero out the wrapped char[] so that it can't be memory-sniffed.

Inherited from org.apache.derby.iapi.types.DataType:
checkHostVariablecoalescecomparecomparecompareTodataTypeConversionequalsflipgenericSetObjectgetBytesgetTypeNamehasStreamininvalidFormatisNotNullisNullOpoutOfRangerecyclesetIntosetObjectsetToNullsetValuesetValuesetValuesetValuesetValuesetValuethrowLangSetMismatchthrowLangSetMismatch