Top Description Fields Constructors Methods
org.hsqldb.types

public final Class BitType

extends BinaryType
Class Inheritance
Imports
java.util.BitSet, org.hsqldb.OpTypes, .Session, .SessionInterface, .Tokens, org.hsqldb.error.Error, .ErrorCode, org.hsqldb.lib.ArrayUtil, .StringConverter, org.hsqldb.map.BitMap

Operations allowed on BIT strings are CONCAT, SUBSTRING, POSITION, BIT_LENGTH and OCTET_LENGTH.

BIT values can be cast to BINARY and vice-versa. In casts, BIT values are converted to their counterpart BINARY values by treating each set of 8 bits or less as a single byte. The first bit of a BIT string is treated as the most significant bit of the resulting byte value. Binary values are converted by treating the bits in the sequence of bytes as sequence of bits in the BIT string

Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.7.3

Field Summary

Modifier and TypeField and Description
pack-priv static final long
Inherited from org.hsqldb.types.BinaryType:
maxBinaryPrecision

Constructor Summary

AccessConstructor and Description
public
BitType(int type, long precision)

Method Summary

Modifier and TypeMethod and Description
public boolean
public int
canMoveFrom(Type otherType)

Overrides org.hsqldb.types.BinaryType.canMoveFrom.

When canConvertFrom() is true, can convert without changing the object

pack-priv Object
public Object
castToType(SessionInterface session, Object a, Type otherType)

Overrides org.hsqldb.types.BinaryType.castToType.

Explicit casts are handled by this method.

public int
public Object
public Object
public Object
convertToDefaultType(SessionInterface session, Object a)

Overrides org.hsqldb.types.BinaryType.convertToDefaultType.

Converts the object to the given type without limit checks.

public void
public String
public String
public Object
convertToType(SessionInterface session, Object a, Type otherType)

Overrides org.hsqldb.types.BinaryType.convertToType.

Same as castToType except for CHARACTER values.

public Object
public int
public Type
getAggregateType(Type other)

Overrides org.hsqldb.types.BinaryType.getAggregateType.

Common type used in comparison operations.

public static BinaryType
getBitType(int type, long precision)

public Type
getCombinedType(Session session, Type other, int operation)

Overrides org.hsqldb.types.BinaryType.getCombinedType.

Returns type for concat

public String
getDefinition()

Overrides org.hsqldb.types.BinaryType.getDefinition.

Returns the full definition of the type, including parameters

public static BitSet
public Class<T>
public String
getJDBCClassName()

Overrides org.hsqldb.types.BinaryType.getJDBCClassName.

Returns the JDBC class name of type, if it exists, otherwise the HSQLDB class name.

public int
getJDBCTypeCode()

Overrides org.hsqldb.types.BinaryType.getJDBCTypeCode.

Returns the JDBC type number of type, if it exists, otherwise the HSQLDB / SQL type.

public long
public String
getNameString()

Overrides org.hsqldb.types.BinaryType.getNameString.

Returns the name of the type

pack-priv int
public int
getSQLGenericTypeCode()

Overrides org.hsqldb.types.Type.getSQLGenericTypeCode.

Returns the generic SQL CLI type number of type, if it exists, otherwise the HSQLDB type.

public boolean
public BlobData
overlay(Session session, BlobData value, BlobData overlay, long offset, long length, boolean hasLength)

Overrides org.hsqldb.types.BinaryType.overlay.

public long
position(SessionInterface session, BlobData data, BlobData otherData, Type otherType, long offset)

Overrides org.hsqldb.types.BinaryType.position.

public boolean
public BlobData
substring(SessionInterface session, BlobData data, long offset, long length, boolean hasLength)

Overrides org.hsqldb.types.BinaryType.substring.

Inherited from org.hsqldb.types.BinaryType:
acceptsPrecisionconvertSQLToJavagetBinaryTypegetNameFullStringgetRightTrimSizeisBinaryTypeprecedenceDegreetrim

Field Detail

maxBitPrecisionback to summary
pack-priv static final long maxBitPrecision

Constructor Detail

BitTypeback to summary
public BitType(int type, long precision)

Method Detail

canConvertFromback to summary
public boolean canConvertFrom(Type otherType)

Overrides org.hsqldb.types.BinaryType.canConvertFrom.

canMoveFromback to summary
public int canMoveFrom(Type otherType)

Overrides org.hsqldb.types.BinaryType.canMoveFrom.

Doc from org.hsqldb.types.Type.canMoveFrom.

When canConvertFrom() is true, can convert without changing the object

castOrConvertToTypeback to summary
pack-priv Object castOrConvertToType(SessionInterface session, Object a, Type otherType, boolean cast)

Overrides org.hsqldb.types.BinaryType.castOrConvertToType.

castToTypeback to summary
public Object castToType(SessionInterface session, Object a, Type otherType)

Overrides org.hsqldb.types.BinaryType.castToType.

Doc from org.hsqldb.types.Type.castToType.

Explicit casts are handled by this method. SQL standard 6.12 rules for enforcement of size, precision and scale are implemented. For CHARACTER values, it performs truncation in all cases of long strings.

compareback to summary
public int compare(Session session, Object a, Object b)

Overrides org.hsqldb.types.BinaryType.compare.

concatback to summary
public Object concat(Session session, Object a, Object b)

Overrides org.hsqldb.types.BinaryType.concat.

convertJavaToSQLback to summary
public Object convertJavaToSQL(SessionInterface session, Object a)

Overrides org.hsqldb.types.BinaryType.convertJavaToSQL.

convertToDefaultTypeback to summary
public Object convertToDefaultType(SessionInterface session, Object a)

Overrides org.hsqldb.types.BinaryType.convertToDefaultType.

Doc from org.hsqldb.types.Type.convertToDefaultType.

Converts the object to the given type without limit checks. Used for JDBC writes.

convertToJSONback to summary
public void convertToJSON(Object a, StringBuilder sb)

Overrides org.hsqldb.types.BinaryType.convertToJSON.

convertToSQLStringback to summary
public String convertToSQLString(Object a)

Overrides org.hsqldb.types.BinaryType.convertToSQLString.

convertToStringback to summary
public String convertToString(Object a)

Overrides org.hsqldb.types.BinaryType.convertToString.

convertToTypeback to summary
public Object convertToType(SessionInterface session, Object a, Type otherType)

Overrides org.hsqldb.types.BinaryType.convertToType.

Doc from org.hsqldb.types.Type.convertToType.

Same as castToType except for CHARACTER values. Perform string truncation of trailing spaces only. For other long strings, it raises an exception.

convertToTypeLimitsback to summary
public Object convertToTypeLimits(SessionInterface session, Object a)

Overrides org.hsqldb.types.BinaryType.convertToTypeLimits.

displaySizeback to summary
public int displaySize()

Overrides org.hsqldb.types.BinaryType.displaySize.

getAggregateTypeback to summary
public Type getAggregateType(Type other)

Overrides org.hsqldb.types.BinaryType.getAggregateType.

Doc from org.hsqldb.types.Type.getAggregateType.

Common type used in comparison operations. other must be comparable with this.

getBitTypeback to summary
public static BinaryType getBitType(int type, long precision)
getCombinedTypeback to summary
public Type getCombinedType(Session session, Type other, int operation)

Overrides org.hsqldb.types.BinaryType.getCombinedType.

Returns type for concat

getDefinitionback to summary
public String getDefinition()

Overrides org.hsqldb.types.BinaryType.getDefinition.

Doc from org.hsqldb.types.Type.getDefinition.

Returns the full definition of the type, including parameters

getJavaBitSetback to summary
public static BitSet getJavaBitSet(BinaryData data)
getJDBCClassback to summary
public Class<T> getJDBCClass()

Overrides org.hsqldb.types.BinaryType.getJDBCClass.

getJDBCClassNameback to summary
public String getJDBCClassName()

Overrides org.hsqldb.types.BinaryType.getJDBCClassName.

Doc from org.hsqldb.types.Type.getJDBCClassName.

Returns the JDBC class name of type, if it exists, otherwise the HSQLDB class name.

getJDBCTypeCodeback to summary
public int getJDBCTypeCode()

Overrides org.hsqldb.types.BinaryType.getJDBCTypeCode.

Doc from org.hsqldb.types.Type.getJDBCTypeCode.

Returns the JDBC type number of type, if it exists, otherwise the HSQLDB / SQL type.

getMaxPrecisionback to summary
public long getMaxPrecision()

Overrides org.hsqldb.types.BinaryType.getMaxPrecision.

getNameStringback to summary
public String getNameString()

Overrides org.hsqldb.types.BinaryType.getNameString.

Doc from org.hsqldb.types.Type.getNameString.

Returns the name of the type

getRightTrimSizeback to summary
pack-priv int getRightTrimSize(BinaryData data)
getSQLGenericTypeCodeback to summary
public int getSQLGenericTypeCode()

Overrides org.hsqldb.types.Type.getSQLGenericTypeCode.

Doc from org.hsqldb.types.Type.getSQLGenericTypeCode.

Returns the generic SQL CLI type number of type, if it exists, otherwise the HSQLDB type. The generic type is returned for DATETIME and INTERVAL types.

isBitTypeback to summary
public boolean isBitType()

Overrides org.hsqldb.types.Type.isBitType.

overlayback to summary
public BlobData overlay(Session session, BlobData value, BlobData overlay, long offset, long length, boolean hasLength)

Overrides org.hsqldb.types.BinaryType.overlay.

positionback to summary
public long position(SessionInterface session, BlobData data, BlobData otherData, Type otherType, long offset)

Overrides org.hsqldb.types.BinaryType.position.

requiresPrecisionback to summary
public boolean requiresPrecision()

Overrides org.hsqldb.types.BinaryType.requiresPrecision.

substringback to summary
public BlobData substring(SessionInterface session, BlobData data, long offset, long length, boolean hasLength)

Overrides org.hsqldb.types.BinaryType.substring.