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

public final Class SQLInteger

extends NumberDataType
Class Inheritance
Imports
org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.services.io.StoredFormatIds, .Storable, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.cache.ClassSize, java.io.ObjectOutput, .ObjectInput, .IOException, java.sql.ResultSet, .PreparedStatement, .SQLException

SQLInteger represents an INTEGER value.

Field Summary

Modifier and TypeField and Description
private static final int
pack-priv static final int
private boolean
private int
Inherited from org.apache.derby.iapi.types.NumberDataType:
MAXLONG_PLUS_ONEMINLONG_MINUS_ONE

Constructor Summary

AccessConstructor and Description
public
SQLInteger()

no-arg constructor, required by Formattable

public
SQLInteger(int val)

public
SQLInteger(char val)

public

Method Summary

Modifier and TypeMethod and Description
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 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.

public boolean
getBoolean()

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

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

Gets the value in the data value descriptor as a boolean.

public byte
getByte()

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

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

Gets the value in the data value descriptor as a byte.

public double
getDouble()

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

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

Gets the value in the data value descriptor as a double.

public float
getFloat()

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

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

Gets the value in the data value descriptor as a float.

public int
getInt()

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

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

Gets the value in the data value descriptor as an int.

public int
getLength()

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

Gets the length of the data value.

public long
getLong()

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

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

Gets the value in the data value descriptor as a 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.

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 short
getShort()

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

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

Gets the value in the data value descriptor as a short.

public String
getString()

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

Gets the value in the data value descriptor as a String.

public int
public String
getTypeName()

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

Get the SQL name of the datatype

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.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

protected boolean

Returns:

A boolean. If this.value is negative, return true. For positive values or null, return false.
isNegative
()

Implements abstract org.apache.derby.iapi.types.NumberDataType.isNegative.

This method implements the isNegative method.

public boolean
isNull()

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

Return whether the value is null or not.

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 NumberDataValue

Returns:

A SQLInteger containing the result of the division
minus
(NumberDataValue
The result of a previous call to this method, null if not called yet
result
)

Implements org.apache.derby.iapi.types.NumberDataValue.minus.

This method implements the unary minus operator for int.

public NumberDataValue
mod(NumberDataValue
The numerator
dividend
,
NumberDataValue
The denominator
divisor
,
NumberDataValue
The result of the previous call to this method, null if not called yet.
result
)

Overrides org.apache.derby.iapi.types.NumberDataType.mod.

Implements org.apache.derby.iapi.types.NumberDataValue.mod.

mod(int, int)

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.

public final 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.

public void
restoreToNull()

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

Restore this object to its (SQL)null value.

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.

public final void
setInto(ResultSet rs, int position)

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

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

Set this value into a ResultSet for a subsequent ResultSet.insertRow or ResultSet.updateRow.

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(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(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(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(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(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
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 NumberDataValue

Returns:

A SQLInteger containing the result of the multiplication
times
(NumberDataValue
The first value to be multiplied
left
,
NumberDataValue
The second value to be multiplied
right
,
NumberDataValue
The result of a previous call to this method, null if not called yet
result
)

Implements org.apache.derby.iapi.types.NumberDataValue.times.

This method implements the * operator for "int * int".

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

protected int
typeCompare(DataValueDescriptor arg)

Implements abstract org.apache.derby.iapi.types.NumberDataType.typeCompare.

Compare this (not null) to a non-null value.

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

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.apache.derby.iapi.types.NumberDataType:
absolutecomparecomparedividedivideminusnormalizeDOUBLEnormalizeREALnormalizeREALobjectNullplussetBigDecimalsetObjectsetValuesetValuesetValuesqrttypeToBigDecimal

Field Detail

BASE_MEMORY_USAGEback to summary
private static final int BASE_MEMORY_USAGE
INTEGER_LENGTHback to summary
pack-priv static final int INTEGER_LENGTH
isnullback to summary
private boolean isnull
valueback to summary
private int value

Constructor Detail

SQLIntegerback to summary
public SQLInteger()

no-arg constructor, required by Formattable

SQLIntegerback to summary
public SQLInteger(int val)
SQLIntegerback to summary
public SQLInteger(char val)
SQLIntegerback to summary
public SQLInteger(Integer obj)

Method Detail

cloneValueback to summary
public DataValueDescriptor cloneValue(boolean forceMaterialization)

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.cloneValue.

Clone this DataValueDescriptor. Results in a new object that has the same value as this but can be modified independently.

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.

Parameters
forceMaterialization: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

Returns:DataValueDescriptor

A clone of the DataValueDescriptor with the same initial value as this.

See Also
DataValueDescriptor#cloneValue
equalsback to summary
public BooleanDataValue equals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException

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.

Parameters
left:DataValueDescriptor

The value on the left side of the =

right:DataValueDescriptor

The value on the right side of the =

Returns:BooleanDataValue

A SQL boolean value telling whether the two parameters are equal

Exceptions
StandardException:
Thrown on error
estimateMemoryUsageback to summary
public int estimateMemoryUsage()

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.estimateMemoryUsage.

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

Returns:int

the estimated memory usage

getBooleanback to summary
public boolean getBoolean()

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getBoolean.

Gets the value in the data value descriptor as a boolean. Throws an exception if the data value is not a boolean. For DataValueDescriptor, this is the preferred interface for BIT, but for this no-casting interface, it isn't, because BIT is stored internally as a Bit, not as a Boolean.

Returns:boolean

The data value as a boolean.

getByteback to summary
public byte getByte() throws StandardException

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getByte.

Gets the value in the data value descriptor as a byte. Throws an exception if the data value is not a byte.

Returns:byte

The data value as a byte.

Exceptions
StandardException:
thrown on failure to convert
getDoubleback to summary
public double getDouble()

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getDouble.

Gets the value in the data value descriptor as a double. Throws an exception if the data value is not a double.

Returns:double

The data value as a double.

getFloatback to summary
public float getFloat()

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getFloat.

Gets the value in the data value descriptor as a float. Throws an exception if the data value is not a float.

Returns:float

The data value as a float.

getIntback to summary
public int getInt()

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getInt.

Gets the value in the data value descriptor as an int. Throws an exception if the data value is not an int.

Returns:int

The data value as a int.

getLengthback to summary
public int getLength()

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getLength.

Gets the length of the data value. The meaning of this is implementation-dependent. For string types, it is the number of characters in the string. For numeric types, it is the number of bytes used to store the number. This is the actual length of this value, not the length of the type it was defined as. For example, a VARCHAR value may be shorter than the declared VARCHAR (maximum) length.

Returns:int

The length of the data value

getLongback to summary
public long getLong()

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getLong.

Gets the value in the data value descriptor as a long. Throws an exception if the data value is not a long.

Returns:long

The data value as a long.

getNewNullback to summary
public DataValueDescriptor getNewNull()

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getNewNull.

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

See Also
DataValueDescriptor#getNewNull
getObjectback to summary
public Object getObject()

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getObject.

Gets the value in the data value descriptor as a Java Object. The type of the Object will be the Java object type corresponding to the data value's SQL type. JDBC defines a mapping between Java object types and SQL types - we will allow that to be extended through user type definitions. Throws an exception if the data value is not an object (yeah, right).

Returns:Object

The data value as an Object.

getShortback to summary
public short getShort() throws StandardException

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getShort.

Gets the value in the data value descriptor as a short. Throws an exception if the data value is not a short.

Returns:short

The data value as a short.

Exceptions
StandardException:
thrown on failure to convert
getStringback to summary
public String getString()

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getString.

Gets the value in the data value descriptor as a String. Throws an exception if the data value is not a string.

Returns:String

The data value as a String.

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Return my format identifier.

Returns:int

Doc from org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

The identifier. (A UUID stuffed in an array of 16 bytes).

See Also
org.apache.derby.iapi.services.io.TypedFormat#getTypeFormatId
getTypeNameback to summary
public String getTypeName()

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.getTypeName.

Get the SQL name of the datatype

Returns:String

The SQL name of the datatype

greaterOrEqualsback to summary
public BooleanDataValue greaterOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException

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.

Parameters
left:DataValueDescriptor

The value on the left side of the operator

right:DataValueDescriptor

The value on the right side of the operator

Returns:BooleanDataValue

A SQL boolean value telling whether the first operand is greater than or equal to the second operand

Exceptions
StandardException:
Thrown on error
greaterThanback to summary
public BooleanDataValue greaterThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException

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.

Parameters
left:DataValueDescriptor

The value on the left side of the operator

right:DataValueDescriptor

The value on the right side of the operator

Returns:BooleanDataValue

A SQL boolean value telling whether the first operand is greater than the second operand

Exceptions
StandardException:
Thrown on error
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

isNegativeback to summary
protected boolean isNegative()

Implements abstract org.apache.derby.iapi.types.NumberDataType.isNegative.

This method implements the isNegative method.

Returns:boolean

A boolean. If this.value is negative, return true. For positive values or null, return false.

isNullback to summary
public boolean isNull()

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

Doc from org.apache.derby.iapi.services.io.Storable.isNull.

Return whether the value is null or not.

Returns:boolean

true if the value is null and false otherwise.

See Also
Storable#isNull
lessOrEqualsback to summary
public BooleanDataValue lessOrEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException

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.

Parameters
left:DataValueDescriptor

The value on the left side of the operator

right:DataValueDescriptor

The value on the right side of the operator

Returns:BooleanDataValue

A SQL boolean value telling whether the first operand is less than or equal to the second operand

Exceptions
StandardException:
Thrown on error
lessThanback to summary
public BooleanDataValue lessThan(DataValueDescriptor left, DataValueDescriptor right) throws StandardException

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.

Parameters
left:DataValueDescriptor

The value on the left side of the operator

right:DataValueDescriptor

The value on the right side of the operator

Returns:BooleanDataValue

A SQL boolean value telling whether the first operand is less than the second operand

Exceptions
StandardException:
Thrown on error
minusback to summary
public NumberDataValue minus(NumberDataValue result) throws StandardException

Implements org.apache.derby.iapi.types.NumberDataValue.minus.

This method implements the unary minus operator for int.

Parameters
result:NumberDataValue

The result of a previous call to this method, null if not called yet

Returns:NumberDataValue

A SQLInteger containing the result of the division

Exceptions
StandardException:
Thrown on error
modback to summary
public NumberDataValue mod(NumberDataValue dividend, NumberDataValue divisor, NumberDataValue result) throws StandardException

Overrides org.apache.derby.iapi.types.NumberDataType.mod.

Implements org.apache.derby.iapi.types.NumberDataValue.mod.

mod(int, int)

Parameters
dividend:NumberDataValue

Doc from org.apache.derby.iapi.types.NumberDataValue.mod.

The numerator

divisor:NumberDataValue

Doc from org.apache.derby.iapi.types.NumberDataValue.mod.

The denominator

result:NumberDataValue

Doc from org.apache.derby.iapi.types.NumberDataValue.mod.

The result of the previous call to this method, null if not called yet.

Returns:NumberDataValue

Doc from org.apache.derby.iapi.types.NumberDataValue.mod.

dividend / divisor

Exceptions
StandardException:

Doc from org.apache.derby.iapi.types.NumberDataValue.mod.

Thrown on error, if result is non-null then its value will be unchanged.

notEqualsback to summary
public BooleanDataValue notEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException

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.

Parameters
left:DataValueDescriptor

The value on the left side of the operator

right:DataValueDescriptor

The value on the right side of the operator

Returns:BooleanDataValue

A SQL boolean value telling whether the two parameters are not equal

Exceptions
StandardException:
Thrown on error
readExternalback to summary
public final void readExternal(ObjectInput in) throws IOException

Implements java.io.Externalizable.readExternal.

Doc from 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. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Parameters
in:ObjectInput

the stream to read data from in order to restore the object

Exceptions
IOException:
if I/O errors occur
See Also
java.io.Externalizable#readExternal
restoreToNullback to summary
public void restoreToNull()

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

Doc from org.apache.derby.iapi.services.io.Storable.restoreToNull.

Restore this object to its (SQL)null value.

See Also
Storable#restoreToNull
setFromback to summary
protected void setFrom(DataValueDescriptor theValue) throws StandardException

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

Doc from org.apache.derby.iapi.types.DataType.setFrom.

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

Parameters
theValue:DataValueDescriptor

The DataValueDescriptor that holds the value to which we want to set this DataValueDescriptor's value.

setIntoback to summary
public final void setInto(PreparedStatement ps, int position) throws SQLException

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

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

Set the value into a PreparedStatement.

Exceptions
SQLException:
Error setting value in PreparedStatement
setIntoback to summary
public final void setInto(ResultSet rs, int position) throws SQLException

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

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

Set this value into a ResultSet for a subsequent ResultSet.insertRow or ResultSet.updateRow. This method will only be called for non-null values.

Exceptions
SQLException:
thrown by the ResultSet object
setValueback to summary
public void setValue(String theValue) throws StandardException

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor.

Parameters
theValue:String

The String value to set this DataValueDescriptor to

Exceptions
StandardException:
thrown if string not accepted
setValueback to summary
public void setValue(int theValue)

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given int value

Parameters
theValue:int

The value to set this DataValueDescriptor to

setValueback to summary
public void setValue(long theValue) throws StandardException

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given long value

Parameters
theValue:long

The value to set this DataValueDescriptor to

Exceptions
StandardException:
thrown on overflow
setValueback to summary
public void setValue(float theValue) throws StandardException

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given double value

Parameters
theValue:float

A Double containing the value to set this DataValueDescriptor to. Null means set the value to SQL null.

Exceptions
StandardException:
Thrown on error
See Also
NumberDataValue#setValue
setValueback to summary
public void setValue(double theValue) throws StandardException

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value of this DataValueDescriptor to the given double value

Parameters
theValue:double

The value to set this DataValueDescriptor to

Exceptions
StandardException:
Thrown on error
See Also
NumberDataValue#setValue
setValueback to summary
public void setValue(boolean theValue)

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.setValue.

Set the value.

Parameters
theValue:boolean

Contains the boolean value to set this to

setValueFromResultSetback to summary
public void setValueFromResultSet(ResultSet resultSet, int colNumber, boolean isNullable) throws SQLException

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.setValueFromResultSet.

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

Parameters
resultSet:ResultSet

The specified ResultSet.

colNumber:int

The 1-based column # into the resultSet.

isNullable:boolean

Whether or not the column is nullable (No need to call wasNull() if not)

Exceptions
SQLException:
Thrown on error
See Also
DataValueDescriptor#setValueFromResultSet
timesback to summary
public NumberDataValue times(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException

Implements org.apache.derby.iapi.types.NumberDataValue.times.

This method implements the * operator for "int * int".

Parameters
left:NumberDataValue

The first value to be multiplied

right:NumberDataValue

The second value to be multiplied

result:NumberDataValue

The result of a previous call to this method, null if not called yet

Returns:NumberDataValue

A SQLInteger containing the result of the multiplication

Exceptions
StandardException:
Thrown on error
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

typeCompareback to summary
protected int typeCompare(DataValueDescriptor arg) throws StandardException

Implements abstract org.apache.derby.iapi.types.NumberDataType.typeCompare.

Doc from org.apache.derby.iapi.types.NumberDataType.typeCompare.

Compare this (not null) to a non-null value.

Exceptions
StandardException:
Thrown on error
typePrecedenceback to summary
public int typePrecedence()

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

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

Doc from org.apache.derby.iapi.types.DataValueDescriptor.typePrecedence.

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.

Returns:int

The precedence of this type.

See Also
DataValueDescriptor#typePrecedence
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Parameters
out:ObjectOutput

the stream to write the object to

Exceptions
IOException:
Includes any I/O exceptions that may occur