org.hsqldb.types
Class BitType
- java.lang.Object
-
- org.hsqldb.types.Type
-
- org.hsqldb.types.BinaryType
-
- org.hsqldb.types.BitType
-
- All Implemented Interfaces:
- java.lang.Cloneable, SchemaObject
public final class BitType extends BinaryType
Operations allowed on BIT strings are CONCAT, SUBSTRING, POSITION, BIT_LENGTH and OCTECT_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 signle byte. The first bit of a BIT string is treated as the most significan bit of the resutling byte value. Binary values are converted by treating the bits in the sequence of bytes as sequence of bits in the BIT string
- Since:
- 1.9.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hsqldb.types.Type
Type.TypedComparator
-
Nested classes/interfaces inherited from interface org.hsqldb.SchemaObject
SchemaObject.ConstraintTypes, SchemaObject.Deferable, SchemaObject.Nullability, SchemaObject.ParameterModes, SchemaObject.ReferentialAction, SchemaObject.ViewCheckModes
-
-
Field Summary
-
Fields inherited from class org.hsqldb.types.BinaryType
maxBinaryPrecision
-
Fields inherited from class org.hsqldb.types.Type
emptyArray, jdbcConvertTypes, OTHER, precision, scale, SQL_ALL_TYPES, SQL_ARRAY_ALL_TYPES, SQL_BIGINT, SQL_BINARY, SQL_BINARY_16, SQL_BINARY_DEFAULT, SQL_BIT, SQL_BIT_VARYING, SQL_BIT_VARYING_MAX_LENGTH, SQL_BLOB, SQL_BOOLEAN, SQL_CHAR, SQL_CHAR_16, SQL_CHAR_DEFAULT, SQL_CLOB, SQL_DATE, SQL_DECIMAL, SQL_DECIMAL_BIGINT_SQR, SQL_DECIMAL_DEFAULT, SQL_DOUBLE, SQL_INTEGER, SQL_INTERVAL_DAY, SQL_INTERVAL_DAY_MAX_PRECISION, SQL_INTERVAL_DAY_TO_HOUR, SQL_INTERVAL_DAY_TO_MINUTE, SQL_INTERVAL_DAY_TO_SECOND, SQL_INTERVAL_DAY_TO_SECOND_MAX_PRECISION, SQL_INTERVAL_HOUR, SQL_INTERVAL_HOUR_MAX_PRECISION, SQL_INTERVAL_HOUR_TO_MINUTE, SQL_INTERVAL_HOUR_TO_SECOND, SQL_INTERVAL_MINUTE, SQL_INTERVAL_MINUTE_MAX_PRECISION, SQL_INTERVAL_MINUTE_TO_SECOND, SQL_INTERVAL_MONTH, SQL_INTERVAL_MONTH_MAX_PRECISION, SQL_INTERVAL_SECOND, SQL_INTERVAL_SECOND_MAX_FRACTION, SQL_INTERVAL_SECOND_MAX_FRACTION_MAX_PRECISION, SQL_INTERVAL_SECOND_MAX_PRECISION, SQL_INTERVAL_YEAR, SQL_INTERVAL_YEAR_MAX_PRECISION, SQL_INTERVAL_YEAR_TO_MONTH, SQL_INTERVAL_YEAR_TO_MONTH_MAX_PRECISION, SQL_NUMERIC, SQL_SMALLINT, SQL_TIME, SQL_TIME_WITH_TIME_ZONE, SQL_TIMESTAMP, SQL_TIMESTAMP_NO_FRACTION, SQL_TIMESTAMP_WITH_TIME_ZONE, SQL_VARBINARY, SQL_VARBINARY_DEFAULT, SQL_VARCHAR, SQL_VARCHAR_DEFAULT, TINYINT, typeAliases, typeCode, typeComparisonGroup, typeDataGroup, typeNames, userTypeModifier
-
Fields inherited from interface org.hsqldb.SchemaObject
ASSERTION, CATALOG, CHARSET, COLLATION, COLUMN, CONSTRAINT, CURSOR, DOMAIN, FUNCTION, GRANTEE, INDEX, LABEL, PARAMETER, PROCEDURE, ROUTINE, SCHEMA, SEARCH, SEQUENCE, SERVER, SPECIFIC_ROUTINE, SUBQUERY, TABLE, TRANSITION, TRIGGER, TYPE, VARIABLE, VIEW, WRAPPER
-
-
Constructor Summary
Constructors Constructor and Description BitType(int type, long precision)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanConvertFrom(Type otherType)java.lang.ObjectcastToType(SessionInterface session, java.lang.Object a, Type otherType)Explicit casts are handled by this method.intcompare(Session session, java.lang.Object a, java.lang.Object b)java.lang.Objectconcat(Session session, java.lang.Object a, java.lang.Object b)java.lang.ObjectconvertJavaToSQL(SessionInterface session, java.lang.Object a)java.lang.ObjectconvertToDefaultType(SessionInterface session, java.lang.Object a)Converts the object to the given type without limit checks.java.lang.StringconvertToSQLString(java.lang.Object a)java.lang.StringconvertToString(java.lang.Object a)java.lang.ObjectconvertToType(SessionInterface session, java.lang.Object a, Type otherType)Same as castToType except for CHARACTER values.java.lang.ObjectconvertToTypeLimits(SessionInterface session, java.lang.Object a)intdisplaySize()TypegetAggregateType(Type other)Common type used in comparison opertions.static BinaryTypegetBitType(int type, long precision)TypegetCombinedType(Session session, Type other, int operation)Returns type for concatjava.lang.StringgetDefinition()Returns the full definition of the type, including parametersjava.lang.ClassgetJDBCClass()java.lang.StringgetJDBCClassName()Returns the JDBC class name of type, if it exists, otherwise the HSQLDB class name.intgetJDBCTypeCode()Returns the JDBC type number of type, if it exists, otherwise the HSQLDB / SQL type.longgetMaxPrecision()java.lang.StringgetNameString()Returns the name of the typeintgetSQLGenericTypeCode()Returns the generic SQL CLI type number of type, if it exists, otherwise the HSQLDB type.booleanisBitType()BlobDataoverlay(Session session, BlobData value, BlobData overlay, long offset, long length, boolean hasLength)longposition(SessionInterface session, BlobData data, BlobData otherData, Type otherType, long offset)booleanrequiresPrecision()BlobDatasubstring(SessionInterface session, BlobData data, long offset, long length, boolean hasLength)-
Methods inherited from class org.hsqldb.types.BinaryType
acceptsPrecision, canMoveFrom, convertSQLToJava, getBinaryType, getNameFullString, isBinaryType, precedenceDegree, trim
-
Methods inherited from class org.hsqldb.types.Type
absolute, acceptsFractionalPrecision, acceptsScale, add, arrayLimitCardinality, canBeAssignedFrom, cardinality, collectionBaseType, compare, compare, compareToTypeRange, compile, convertToTypeJDBC, divide, duplicate, equals, getAggregateType, getCatalogName, getChangeTimestamp, getCharacterSet, getCollation, getComponents, getDefaultArrayType, getDefaultType, getDefaultTypeWithSize, getFullNameString, getHSQLDBTypeCode, getJDBCPrecision, getJDBCScale, getJDBCTypeCode, getMaxScale, getName, getOwner, getPrecisionRadix, getReferences, getSchemaName, getSQL, getType, getType, getType, getTypeDefinition, getTypeForJDBCConvertToken, getTypeNr, hashCode, isArrayType, isBooleanType, isCharacterType, isDateOrTimestampType, isDateTimeType, isDateTimeTypeWithZone, isDecimalType, isDistinctType, isDomainType, isExactNumberType, isIntegralType, isIntervalType, isLobType, isMultisetType, isNumberType, isObjectType, isRowType, isStructuredType, isSupportedSQLType, matches, multiply, negate, newComparator, subtract
-
-
-
-
Method Detail
-
displaySize
public int displaySize()
- Overrides:
displaySizein classBinaryType
-
getJDBCTypeCode
public int getJDBCTypeCode()
Description copied from class:TypeReturns the JDBC type number of type, if it exists, otherwise the HSQLDB / SQL type.- Overrides:
getJDBCTypeCodein classBinaryType
-
getJDBCClass
public java.lang.Class getJDBCClass()
- Overrides:
getJDBCClassin classBinaryType
-
getJDBCClassName
public java.lang.String getJDBCClassName()
Description copied from class:TypeReturns the JDBC class name of type, if it exists, otherwise the HSQLDB class name.- Overrides:
getJDBCClassNamein classBinaryType
-
getSQLGenericTypeCode
public int getSQLGenericTypeCode()
Description copied from class:TypeReturns 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.- Overrides:
getSQLGenericTypeCodein classType
-
getNameString
public java.lang.String getNameString()
Description copied from class:TypeReturns the name of the type- Overrides:
getNameStringin classBinaryType
-
getDefinition
public java.lang.String getDefinition()
Description copied from class:TypeReturns the full definition of the type, including parameters- Overrides:
getDefinitionin classBinaryType
-
getMaxPrecision
public long getMaxPrecision()
- Overrides:
getMaxPrecisionin classBinaryType
-
requiresPrecision
public boolean requiresPrecision()
- Overrides:
requiresPrecisionin classBinaryType
-
getAggregateType
public Type getAggregateType(Type other)
Description copied from class:TypeCommon type used in comparison opertions. other must be comparable with this.- Overrides:
getAggregateTypein classBinaryType
-
getCombinedType
public Type getCombinedType(Session session, Type other, int operation)
Returns type for concat- Overrides:
getCombinedTypein classBinaryType
-
compare
public int compare(Session session, java.lang.Object a, java.lang.Object b)
- Overrides:
comparein classBinaryType
-
convertToTypeLimits
public java.lang.Object convertToTypeLimits(SessionInterface session, java.lang.Object a)
- Overrides:
convertToTypeLimitsin classBinaryType
-
castToType
public java.lang.Object castToType(SessionInterface session, java.lang.Object a, Type otherType)
Description copied from class:TypeExplicit 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.- Overrides:
castToTypein classBinaryType
-
convertToType
public java.lang.Object convertToType(SessionInterface session, java.lang.Object a, Type otherType)
Description copied from class:TypeSame as castToType except for CHARACTER values. Perform string truncation of trailing spaces only. For other long strings, it raises an exception.- Overrides:
convertToTypein classBinaryType
-
convertToDefaultType
public java.lang.Object convertToDefaultType(SessionInterface session, java.lang.Object a)
Description copied from class:TypeConverts the object to the given type without limit checks. Used for JDBC writes.- Overrides:
convertToDefaultTypein classBinaryType
-
convertJavaToSQL
public java.lang.Object convertJavaToSQL(SessionInterface session, java.lang.Object a)
- Overrides:
convertJavaToSQLin classBinaryType
-
convertToString
public java.lang.String convertToString(java.lang.Object a)
- Overrides:
convertToStringin classBinaryType
-
convertToSQLString
public java.lang.String convertToSQLString(java.lang.Object a)
- Overrides:
convertToSQLStringin classBinaryType
-
canConvertFrom
public boolean canConvertFrom(Type otherType)
- Overrides:
canConvertFromin classBinaryType
-
position
public long position(SessionInterface session, BlobData data, BlobData otherData, Type otherType, long offset)
- Overrides:
positionin classBinaryType
-
substring
public BlobData substring(SessionInterface session, BlobData data, long offset, long length, boolean hasLength)
- Overrides:
substringin classBinaryType
-
overlay
public BlobData overlay(Session session, BlobData value, BlobData overlay, long offset, long length, boolean hasLength)
- Overrides:
overlayin classBinaryType
-
concat
public java.lang.Object concat(Session session, java.lang.Object a, java.lang.Object b)
- Overrides:
concatin classBinaryType
-
getBitType
public static BinaryType getBitType(int type, long precision)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG