|
|||||||||
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.impl.store.access.StorableFormatId
public class StorableFormatId
Field Summary | |
---|---|
private static int |
BASE_MEMORY_USAGE
|
private int |
format_id
|
Fields inherited from interface org.apache.derby.iapi.types.DataValueDescriptor |
---|
UNKNOWN_LOGICAL_LENGTH |
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 | |
---|---|
StorableFormatId()
|
|
StorableFormatId(int value)
|
Method Summary | |
---|---|
DataValueDescriptor |
cloneValue(boolean forceMaterialization)
Clone this DataValueDescriptor. |
int |
compare(DataValueDescriptor other)
Compare this Orderable with a given Orderable for the purpose of index positioning. |
int |
estimateMemoryUsage()
Estimate the memory usage in bytes of the data value and the overhead of the class. |
int |
getLength()
Gets the length of the data value. |
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. |
java.lang.String |
getString()
Gets the value in the data value descriptor as a String. |
int |
getTypeFormatId()
Return my format identifier. |
java.lang.String |
getTypeName()
Get the SQL name of the datatype |
int |
getValue()
|
boolean |
isNull()
Return whether the value is null or not. |
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. |
protected void |
setFrom(DataValueDescriptor theValue)
Set the value of this DataValueDescriptor from another. |
void |
setValue(int input_value)
Set the value of this DataValueDescriptor to the given int value At DataType level just throws an error lower classes will override |
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. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.apache.derby.iapi.types.DataType |
---|
checkHostVariable, cloneHolder, coalesce, compare, compare, compare, compareTo, dataTypeConversion, equals, equals, flip, getBoolean, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLong, getNationalString, getShort, getStream, getTime, getTimestamp, getTraceString, greaterOrEquals, greaterThan, hasStream, in, invalidFormat, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, notEquals, outOfRange, recycle, setBigDecimal, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, throwLangSetMismatch, typePrecedence, typeToBigDecimal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int format_id
private static final int BASE_MEMORY_USAGE
Constructor Detail |
---|
public StorableFormatId()
public StorableFormatId(int value)
Method Detail |
---|
public int estimateMemoryUsage()
DataValueDescriptor
public int getValue()
public void setValue(int input_value)
DataType
setValue
in interface DataValueDescriptor
setValue
in class DataType
input_value
- The value to set this DataValueDescriptor topublic int getTypeFormatId()
TypedFormat.getTypeFormatId()
public boolean isNull()
Storable
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
java.io.IOException
Externalizable.readExternal(java.io.ObjectInput)
public void readExternalFromArray(ArrayInputStream in) throws java.io.IOException
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().
in
- The array stream positioned at the beginning of the
byte stream to read from.
java.io.IOException
- Usual error is if you try to read
past limit on the stream.public void restoreToNull()
Storable
public int getLength() throws StandardException
StandardException
- On errorDataValueDescriptor.getLength()
public java.lang.String getString() throws StandardException
StandardException
- Thrown on errorDataValueDescriptor.getString()
public java.lang.Object getObject() throws StandardException
getObject
in interface DataValueDescriptor
getObject
in class DataType
StandardException
- Thrown on errorDataValueDescriptor.getObject()
public DataValueDescriptor cloneValue(boolean forceMaterialization)
DataValueDescriptor
Even though the objects can be modified independently regardless of the
value of forceMaterialization
, both the clone and the
original may be dependent on the store state if
forceMaterialization
is set to false
. An example is if
you need to access the value you just read using cloneValue
after the current transaction has ended, or after the source result set
has been closed.
forceMaterialization
- any streams representing the data value will
be materialized if true
, the data value will be kept as a
stream if possible if false
DataValueDescriptor
with the same initial
value as this.DataValueDescriptor.cloneValue(boolean)
public DataValueDescriptor getNewNull()
DataValueDescriptor.getNewNull()
public void setValueFromResultSet(java.sql.ResultSet resultSet, int colNumber, boolean isNullable) throws StandardException, java.sql.SQLException
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)
StandardException
- Thrown on error
java.sql.SQLException
- Error accessing the result setDataValueDescriptor.setValueFromResultSet(java.sql.ResultSet, int, boolean)
protected void setFrom(DataValueDescriptor theValue) throws StandardException
setFrom
in class DataType
theValue
- The Date value to set this DataValueDescriptor to
StandardException
DataValueDescriptor.setValue(int)
public java.lang.String getTypeName()
DataValueDescriptor.getTypeName()
public int compare(DataValueDescriptor other) throws StandardException
other
- The Orderable to compare this one to.
StandardException
- Thrown on errorDataValueDescriptor.compare(org.apache.derby.iapi.types.DataValueDescriptor)
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |