Package org.apache.derby.iapi.types
Interface BooleanDataValue
-
- All Superinterfaces:
DataValueDescriptor
,java.io.Externalizable
,Formatable
,Orderable
,java.io.Serializable
,Storable
,TypedFormat
- All Known Implementing Classes:
SQLBoolean
public interface BooleanDataValue extends DataValueDescriptor
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BooleanDataValue
and(BooleanDataValue otherValue)
The SQL AND operator.boolean
equals(boolean value)
Tell whether a BooleanDataValue has the given value.boolean
getBoolean()
Gets the value in the data value descriptor as a boolean.BooleanDataValue
getImmutable()
Return an immutable BooleanDataValue with the same value as this.BooleanDataValue
is(BooleanDataValue otherValue)
The SQL IS operator - consult any standard SQL reference for an explanation.BooleanDataValue
isNot(BooleanDataValue otherValue)
Implements NOT IS.BooleanDataValue
or(BooleanDataValue otherValue)
The SQL OR operator.void
setValue(java.lang.Boolean theValue)
Set the value of this BooleanDataValue.BooleanDataValue
throwExceptionIfFalse(java.lang.String SQLState, java.lang.String tableName, java.lang.String constraintName)
Throw an exception with the given SQLState if this BooleanDataValue is false.BooleanDataValue
throwExceptionIfImmediateAndFalse(java.lang.String SQLState, java.lang.String tableName, java.lang.String constraintName, Activation a, int savedUUIDIdx)
If this value is false and we have a deferred constraint, remember the violation and proceed, else throw.-
Methods inherited from interface org.apache.derby.iapi.types.DataValueDescriptor
checkHostVariable, cloneHolder, cloneValue, coalesce, compare, compare, compare, compare, equals, estimateMemoryUsage, getByte, getBytes, getDate, getDouble, getFloat, getInt, getLength, getLong, getNewNull, getObject, getShort, getStream, getString, getTime, getTimestamp, getTraceString, getTypeName, greaterOrEquals, greaterThan, hasStream, in, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, notEquals, readExternalFromArray, recycle, setBigDecimal, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueFromResultSet, typePrecedence, typeToBigDecimal
-
Methods inherited from interface org.apache.derby.iapi.services.io.Storable
isNull, restoreToNull
-
Methods inherited from interface org.apache.derby.iapi.services.io.TypedFormat
getTypeFormatId
-
-
-
-
Method Detail
-
getBoolean
boolean getBoolean()
Description copied from interface:DataValueDescriptor
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.- Specified by:
getBoolean
in interfaceDataValueDescriptor
- Returns:
- The data value as a boolean.
-
and
BooleanDataValue and(BooleanDataValue otherValue)
The SQL AND operator. This provides SQL semantics for AND with unknown truth values - consult any standard SQL reference for an explanation.- Parameters:
otherValue
- The other BooleanDataValue to AND with this one- Returns:
- this AND otherValue
-
or
BooleanDataValue or(BooleanDataValue otherValue)
The SQL OR operator. This provides SQL semantics for OR with unknown truth values - consult any standard SQL reference for an explanation.- Parameters:
otherValue
- The other BooleanDataValue to OR with this one- Returns:
- this OR otherValue
-
is
BooleanDataValue is(BooleanDataValue otherValue)
The SQL IS operator - consult any standard SQL reference for an explanation. Implements the following truth table: otherValue | TRUE | FALSE | UNKNOWN this |---------------------------- | TRUE | TRUE | FALSE | FALSE FALSE | FALSE | TRUE | FALSE UNKNOWN | FALSE | FALSE | TRUE- Parameters:
otherValue
- BooleanDataValue to compare to. May be TRUE, FALSE, or UNKNOWN.- Returns:
- whether this IS otherValue
-
isNot
BooleanDataValue isNot(BooleanDataValue otherValue)
Implements NOT IS. This reverses the sense of the is() call.- Parameters:
otherValue
- BooleanDataValue to compare to. May be TRUE, FALSE, or UNKNOWN.- Returns:
- NOT( this IS otherValue )
-
throwExceptionIfFalse
BooleanDataValue throwExceptionIfFalse(java.lang.String SQLState, java.lang.String tableName, java.lang.String constraintName) throws StandardException
Throw an exception with the given SQLState if this BooleanDataValue is false. This method is useful for evaluating constraints.- Parameters:
SQLState
- The SQLState of the exception to throw if this SQLBoolean is false.tableName
- The name of the table to include in the exception message.constraintName
- The name of the failed constraint to include in the exception message.- Returns:
- this
- Throws:
StandardException
- Thrown if this BooleanDataValue is false.
-
throwExceptionIfImmediateAndFalse
BooleanDataValue throwExceptionIfImmediateAndFalse(java.lang.String SQLState, java.lang.String tableName, java.lang.String constraintName, Activation a, int savedUUIDIdx) throws StandardException
If this value is false and we have a deferred constraint, remember the violation and proceed, else throw. See alsoAndNoShortCircuitNode
.- Parameters:
SQLState
- The SQLState of the exception to throw if this SQLBoolean is false.tableName
- The name of the table to include in the exception message.constraintName
- The name of the failed constraint to include in the exception message.a
- The activationsavedUUIDIdx
- The saved object number of the constraint's UUID.- Returns:
- this
- Throws:
StandardException
- Thrown if this BooleanDataValue is false.
-
setValue
void setValue(java.lang.Boolean theValue)
Set the value of this BooleanDataValue.- Parameters:
theValue
- Contains the boolean value to set this BooleanDataValue to. Null means set this BooleanDataValue to null.
-
equals
boolean equals(boolean value)
Tell whether a BooleanDataValue has the given value. This is useful for short-circuiting.- Parameters:
value
- The value to look for- Returns:
- true if the BooleanDataValue contains the given value.
-
getImmutable
BooleanDataValue getImmutable()
Return an immutable BooleanDataValue with the same value as this.- Returns:
- An immutable BooleanDataValue with the same value as this.
-
-