org.apache.derby.iapi.types
Class SQLNClob

java.lang.Object
  extended byorg.apache.derby.iapi.types.DataType
      extended byorg.apache.derby.iapi.types.SQLChar
          extended byorg.apache.derby.iapi.types.SQLVarchar
              extended byorg.apache.derby.iapi.types.SQLNationalVarchar
                  extended byorg.apache.derby.iapi.types.SQLNClob
All Implemented Interfaces:
CloneableObject, ConcatableDataValue, DataValueDescriptor, java.io.Externalizable, Formatable, Orderable, java.io.Serializable, Storable, StreamStorable, StringDataValue, TypedFormat, VariableSizeDataValue

public class SQLNClob
extends SQLNationalVarchar

SQLNClob satisfies the DataValueDescriptor interfaces (i.e., OrderableDataType). It implements a 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.

----- TODO: fix for NCLOB Because OrderableDataType is a subclass of DataType, SQLNationalLongvarchar can play a role in either a DataType/ValueRow or a OrderableDataType/KeyRow, interchangeably. ----- TODO: fix for NCLOB SQLNationalLongvarchar is mostly the same as SQLLongvarchar, so it is implemented as a subclass of SQLLongvarchar. Only those methods with different behavior are implemented here.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.derby.iapi.types.SQLChar
arg_passer, RETURN_SPACE_THRESHOLD, stream
 
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
SQLNClob()
           
SQLNClob(java.lang.String val, LocaleFinder localeFinder)
           
 
Method Summary
 DataValueDescriptor getClone()
          Clone this DataValueDescriptor.
 java.sql.Date getDate(java.util.Calendar cal)
          Gets the value in the data value descriptor as a java.sql.Date.
 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.sql.Time getTime(java.util.Calendar cal)
          Gets the value in the data value descriptor as a java.sql.Time.
 java.sql.Timestamp getTimestamp(java.util.Calendar cal)
          Gets the value in the data value descriptor as a java.sql.Timestamp.
 int getTypeFormatId()
          Return my format identifier.
 java.lang.String getTypeName()
          Get the SQL name of the datatype
 int hashCode()
           
protected  boolean isNationalString()
          Return whether or not this is a national character datatype.
protected  void setFrom(DataValueDescriptor theValue)
           
 void setValue(java.sql.Date theValue, java.util.Calendar cal)
          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.
protected  int stringCompare(SQLChar char1, SQLChar char2)
          ---- TODO: Disable?
 int typePrecedence()
          Each built-in type in JSQL has a precedence.
 
Methods inherited from class org.apache.derby.iapi.types.SQLNationalVarchar
normalize
 
Methods inherited from class org.apache.derby.iapi.types.SQLVarchar
growBy, normalize
 
Methods inherited from class org.apache.derby.iapi.types.SQLChar
appendBlanks, charLength, cloneObject, compare, compare, concatenate, copyState, equals, estimateMemoryUsage, getBoolean, getByte, getCharArray, getCollationKey, getDate, getDateFormat, getDateFormat, getDouble, getFloat, getInt, getLength, getLocaleFinder, getLong, getObject, getShort, getStream, getString, getTime, getTimeFormat, getTimeFormat, getTimestamp, getTimestampFormat, getTimestampFormat, greaterOrEquals, greaterThan, hasNonBlankChars, isNull, lessOrEquals, lessThan, like, like, loadStream, locate, lower, nationalGetDate, nationalGetTime, nationalGetTimestamp, nationalHashCode, notEquals, readExternal, readExternalFromArray, restoreToNull, returnStream, setBigDecimal, setInto, setLocaleFinder, setStream, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFromResultSet, setWidth, stringCollatorCompare, stringCompare, stringCompare, substring, toString, trim, typeToBigDecimal, upper, writeExternal, XMLParse
 
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
 

Constructor Detail

SQLNClob

public SQLNClob()

SQLNClob

public SQLNClob(java.lang.String val,
                LocaleFinder localeFinder)
Method Detail

getTypeName

public java.lang.String getTypeName()
Description copied from interface: DataValueDescriptor
Get the SQL name of the datatype

Specified by:
getTypeName in interface DataValueDescriptor
Overrides:
getTypeName in class SQLNationalVarchar

getClone

public DataValueDescriptor getClone()
Description copied from interface: DataValueDescriptor
Clone this DataValueDescriptor. Results in a new object that has the same value as this but can be modified independently.

Specified by:
getClone in interface DataValueDescriptor
Overrides:
getClone in class SQLNationalVarchar
See Also:
DataValueDescriptor.getClone()

getNewNull

public DataValueDescriptor getNewNull()
Description copied from interface: DataValueDescriptor
Get a new null value of the same type as this data value.

Specified by:
getNewNull in interface DataValueDescriptor
Overrides:
getNewNull in class SQLNationalVarchar
See Also:
DataValueDescriptor.getNewNull()

getTypeFormatId

public int getTypeFormatId()
Return my format identifier.

Specified by:
getTypeFormatId in interface TypedFormat
Overrides:
getTypeFormatId in class SQLNationalVarchar
See Also:
TypedFormat.getTypeFormatId()

getDate

public java.sql.Date getDate(java.util.Calendar cal)
                      throws StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a java.sql.Date. Throws an exception if the data value is not a Date.

Specified by:
getDate in interface DataValueDescriptor
Overrides:
getDate in class SQLNationalVarchar
Throws:
StandardException - thrown on failure to convert
See Also:
DataValueDescriptor.getDate(java.util.Calendar)

getTime

public java.sql.Time getTime(java.util.Calendar cal)
                      throws StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a java.sql.Time. Throws an exception if the data value is not a Time.

Specified by:
getTime in interface DataValueDescriptor
Overrides:
getTime in class SQLNationalVarchar
Throws:
StandardException - thrown on failure to convert
See Also:
DataValueDescriptor.getTime(java.util.Calendar)

getTimestamp

public java.sql.Timestamp getTimestamp(java.util.Calendar cal)
                                throws StandardException
Description copied from interface: DataValueDescriptor
Gets the value in the data value descriptor as a java.sql.Timestamp. Throws an exception if the data value is not a Timestamp.

Specified by:
getTimestamp in interface DataValueDescriptor
Overrides:
getTimestamp in class SQLNationalVarchar
Throws:
StandardException - thrown on failure to convert
See Also:
DataValueDescriptor.getTimestamp(java.util.Calendar)

typePrecedence

public int typePrecedence()
Description copied from interface: DataValueDescriptor
Each built-in type in JSQL has a precedence. This precedence determines how to do type promotion when using binary operators. For example, float has a higher precedence than int, so when adding an int to a float, the result type is float. The precedence for some types is arbitrary. For example, it doesn't matter what the precedence of the boolean type is, since it can't be mixed with other types. But the precedence for the number types is critical. The SQL standard requires that exact numeric types be promoted to approximate numeric when one operator uses both. Also, the precedence is arranged so that one will not lose precision when promoting a type.

Specified by:
typePrecedence in interface DataValueDescriptor
Overrides:
typePrecedence in class SQLNationalVarchar

stringCompare

protected int stringCompare(SQLChar char1,
                            SQLChar char2)
                     throws StandardException
---- TODO: Disable? Compare two SQLChars. This method will be overriden in the National char wrappers so that the appropriate comparison is done.

Overrides:
stringCompare in class SQLNationalVarchar
Throws:
StandardException - Thrown on error

getNewVarchar

protected StringDataValue getNewVarchar()
Get a SQLVarchar for a built-in string function. (Could be either a SQLVarchar or SQLNationalVarchar.)

Overrides:
getNewVarchar in class SQLNationalVarchar
Returns:
a SQLVarchar or SQLNationalVarchar.

isNationalString

protected boolean isNationalString()
Return whether or not this is a national character datatype.

Overrides:
isNationalString in class SQLNationalVarchar

setValue

public void setValue(java.sql.Date theValue,
                     java.util.Calendar cal)
              throws StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLNationalVarchar
Throws:
StandardException - Thrown on error
See Also:
DataValueDescriptor.setValue(java.lang.Object)

setValue

public void setValue(java.sql.Time theValue,
                     java.util.Calendar cal)
              throws StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLNationalVarchar
Throws:
StandardException - Thrown on error
See Also:
DataValueDescriptor.setValue(java.lang.Object)

setValue

public void setValue(java.sql.Timestamp theValue,
                     java.util.Calendar cal)
              throws StandardException
Description copied from interface: DataValueDescriptor
Set the value of this DataValueDescriptor.

Specified by:
setValue in interface DataValueDescriptor
Overrides:
setValue in class SQLNationalVarchar
Throws:
StandardException - Thrown on error
See Also:
DataValueDescriptor.setValue(java.lang.Object)

setFrom

protected void setFrom(DataValueDescriptor theValue)
                throws StandardException
Overrides:
setFrom in class SQLNationalVarchar
Throws:
StandardException

hashCode

public int hashCode()
Overrides:
hashCode in class SQLNationalVarchar
See Also:
Object.hashCode()

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.