|
||||||||||
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.UserType
This contains an instance of a user-defined type, that is, a java object.
Field Summary | |
private static int |
BASE_MEMORY_USAGE
|
private java.lang.Object |
value
|
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 |
Constructor Summary | |
UserType()
no-arg constructor required by Formattable |
|
UserType(java.lang.Object value)
|
Method Summary | |
int |
compare(DataValueDescriptor other)
Orderable interface |
boolean |
compare(int op,
DataValueDescriptor other,
boolean orderedNulls,
boolean unknownRV)
Compare this Orderable with a given Orderable for the purpose of qualification and sorting. |
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. |
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. |
byte[] |
getBytes()
Gets the value in the data value descriptor as a byte array. |
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. |
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. |
int |
getLength()
Gets the length of the data value. |
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. |
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.lang.String |
getString()
Gets the value in the data value descriptor as a String. |
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()
|
boolean |
isNull()
Check if the value is null. |
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)
Read the DataValueDescriptor from the stream. |
void |
restoreToNull()
Restore this object to its (SQL)null value. |
void |
setBigDecimal(java.lang.Number theValue)
Set this value from an application supplied java.math.BigDecimal. |
protected void |
setFrom(DataValueDescriptor theValue)
|
void |
setObjectForCast(java.lang.Object theValue,
boolean instanceOfResultType,
java.lang.String resultTypeClassName)
Set the Object that this Data Type contains (for an explicit cast). |
void |
setValue(java.lang.Object value)
Set the value of this UserDataValue to the given Object |
void |
setValue(java.lang.String theValue)
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. |
java.lang.String |
toString()
|
int |
typePrecedence()
Each built-in type in JSQL has a precedence. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.derby.iapi.types.DataType |
checkHostVariable, cloneObject, coalesce, dataTypeConversion, equals, flip, genericSetObject, getNationalString, getStream, greaterOrEquals, greaterThan, in, invalidFormat, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, outOfRange, setInto, setInto, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, throwLangSetMismatch, throwLangSetMismatch, typeToBigDecimal |
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, getStream, greaterOrEquals, greaterThan, in, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, setInto, setInto, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, typeToBigDecimal |
Field Detail |
private java.lang.Object value
private static final int BASE_MEMORY_USAGE
Constructor Detail |
public UserType()
public UserType(java.lang.Object value)
Method Detail |
public int estimateMemoryUsage()
DataValueDescriptor
estimateMemoryUsage
in interface DataValueDescriptor
public java.lang.String getString()
DataValueDescriptor
getString
in interface DataValueDescriptor
public boolean getBoolean() throws StandardException
DataValueDescriptor
getBoolean
in interface DataValueDescriptor
getBoolean
in class DataType
StandardException
- thrown on failure to convertpublic byte getByte() throws StandardException
DataValueDescriptor
getByte
in interface DataValueDescriptor
getByte
in class DataType
StandardException
- thrown on failure to convertpublic short getShort() throws StandardException
DataValueDescriptor
getShort
in interface DataValueDescriptor
getShort
in class DataType
StandardException
- thrown on failure to convertpublic int getInt() throws StandardException
DataValueDescriptor
getInt
in interface DataValueDescriptor
getInt
in class DataType
StandardException
- thrown on failure to convertpublic long getLong() throws StandardException
DataValueDescriptor
getLong
in interface DataValueDescriptor
getLong
in class DataType
StandardException
- thrown on failure to convertpublic float getFloat() throws StandardException
DataValueDescriptor
getFloat
in interface DataValueDescriptor
getFloat
in class DataType
StandardException
- thrown on failure to convertpublic double getDouble() throws StandardException
DataValueDescriptor
getDouble
in interface DataValueDescriptor
getDouble
in class DataType
StandardException
- thrown on failure to convertpublic byte[] getBytes() throws StandardException
DataValueDescriptor
getBytes
in interface DataValueDescriptor
getBytes
in class DataType
StandardException
- thrown on failure to convertpublic java.sql.Date getDate(java.util.Calendar cal) throws StandardException
DataValueDescriptor
getDate
in interface DataValueDescriptor
getDate
in class DataType
cal
- calendar for object creation
StandardException
- thrown on failurepublic java.sql.Time getTime(java.util.Calendar cal) throws StandardException
DataValueDescriptor
getTime
in interface DataValueDescriptor
getTime
in class DataType
cal
- calendar for object creation
StandardException
- thrown on failurepublic java.sql.Timestamp getTimestamp(java.util.Calendar cal) throws StandardException
DataValueDescriptor
getTimestamp
in interface DataValueDescriptor
getTimestamp
in class DataType
cal
- calendar for object creation
StandardException
- thrown on failurepublic java.lang.Object getObject()
DataValueDescriptor
getObject
in interface DataValueDescriptor
getObject
in class DataType
public void setObjectForCast(java.lang.Object theValue, boolean instanceOfResultType, java.lang.String resultTypeClassName) throws StandardException
DataValueDescriptor
setObjectForCast
in interface DataValueDescriptor
setObjectForCast
in class DataType
StandardException
- thrown on failureDataValueDescriptor.setObjectForCast(java.lang.Object, boolean, java.lang.String)
public int getLength()
DataValueDescriptor
getLength
in interface DataValueDescriptor
public java.lang.String getTypeName()
DataValueDescriptor
getTypeName
in interface DataValueDescriptor
public int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
TypedFormat.getTypeFormatId()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
- error writing datapublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
- Thrown on error reading the object
java.lang.ClassNotFoundException
- Thrown if the class of the object
is not foundExternalizable.readExternal(java.io.ObjectInput)
public void readExternalFromArray(ArrayInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
DataValueDescriptor
Initialize the data value by reading it's values from the ArrayInputStream. This interface is provided as a way to achieve possible performance enhancement when reading an array can be optimized over reading from a generic stream from readExternal().
readExternalFromArray
in interface DataValueDescriptor
in
- The array stream positioned at the beginning of the
byte stream to read from.
java.lang.ClassNotFoundException
- If a necessary class can not be
found while reading the object from
the stream.
java.io.IOException
- Usual error is if you try to read
past limit on the stream.public DataValueDescriptor getClone()
DataValueDescriptor
getClone
in interface DataValueDescriptor
DataValueDescriptor.getClone()
public DataValueDescriptor getNewNull()
DataValueDescriptor
getNewNull
in interface DataValueDescriptor
DataValueDescriptor.getNewNull()
public void restoreToNull()
Storable
restoreToNull
in interface Storable
Storable.restoreToNull()
public void setValueFromResultSet(java.sql.ResultSet resultSet, int colNumber, boolean isNullable) throws java.sql.SQLException
DataValueDescriptor
setValueFromResultSet
in interface DataValueDescriptor
resultSet
- 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 int compare(DataValueDescriptor other) throws StandardException
compare
in interface DataValueDescriptor
other
- The Orderable to compare this one to.
StandardException
- thrown on failureOrderable
public boolean compare(int op, DataValueDescriptor other, boolean orderedNulls, boolean unknownRV) throws StandardException
DataValueDescriptor
compare
in interface DataValueDescriptor
compare
in class DataType
StandardException
- thrown on errorpublic void setValue(java.lang.Object value)
UserDataValue
setValue
in interface UserDataValue
setValue
in class DataType
UserDataValue.setValue(java.lang.Object)
protected void setFrom(DataValueDescriptor theValue) throws StandardException
setFrom
in class DataType
StandardException
public void setBigDecimal(java.lang.Number theValue)
DataValueDescriptor
setBigDecimal
in interface DataValueDescriptor
setBigDecimal
in class DataType
UserDataValue.setValue(java.lang.Object)
public void setValue(java.lang.String theValue)
DataValueDescriptor
setValue
in interface DataValueDescriptor
setValue
in class DataType
theValue
- The BigDecimal value to set this DataValueDescriptor to
public BooleanDataValue equals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException
equals
in interface DataValueDescriptor
equals
in class DataType
left
- The value on the left side of the =right
- The value on the right side of the =
StandardException
- Thrown on errorpublic BooleanDataValue notEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException
notEquals
in interface DataValueDescriptor
notEquals
in class DataType
left
- The value on the left side of the <>right
- The value on the right side of the <>
StandardException
- Thrown on errorpublic java.lang.String toString()
public int hashCode()
public int typePrecedence()
DataValueDescriptor
typePrecedence
in interface DataValueDescriptor
typePrecedence
in class DataType
DataValueDescriptor.typePrecedence()
public final boolean isNull()
isNull
in interface Storable
|
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 |