Package com.mckoi.database
Class TBinaryType
- java.lang.Object
-
- com.mckoi.database.TType
-
- com.mckoi.database.TBinaryType
-
- All Implemented Interfaces:
java.io.Serializable
public class TBinaryType extends TType
An implementation of TType for a binary block of data.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private intmax_sizeThis constrained size of the binary block of data or -1 if there is no size limit.(package private) static longserialVersionUID-
Fields inherited from class com.mckoi.database.TType
ARRAY_TYPE, BINARY_TYPE, BOOLEAN_TYPE, DATE_TYPE, NULL_TYPE, NUMERIC_TYPE, QUERY_PLAN_TYPE, STRING_TYPE
-
-
Constructor Summary
Constructors Constructor Description TBinaryType(int sql_type, int max_size)Constructs the type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcalculateApproximateMemoryUse(java.lang.Object ob)Calculates the approximate memory usage of an object of this type in bytes.booleancomparableTypes(TType type)Returns true if the type of this object is logically comparable to the type of the given object.(package private) static intcompareBlobs(BlobAccessor blob1, BlobAccessor blob2)Utility method for comparing one blob with another.intcompareObs(java.lang.Object ob1, java.lang.Object ob2)Compares two objects that are logically comparable under this type.intgetMaximumSize()Returns the maximum size of this binary type.java.lang.ClassjavaClass()Returns the Java Class that is used to represent this type of object.-
Methods inherited from class com.mckoi.database.TType
asEncodedString, asEncodedString, asSQLString, binaryType, booleanType, castObjectToTType, dateType, decodeString, decodeTypes, fromClass, getSQLType, getWidestType, javaObjectType, numericType, stringType
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
max_size
private int max_size
This constrained size of the binary block of data or -1 if there is no size limit.
-
-
Method Detail
-
getMaximumSize
public int getMaximumSize()
Returns the maximum size of this binary type.
-
compareBlobs
static int compareBlobs(BlobAccessor blob1, BlobAccessor blob2)
Utility method for comparing one blob with another. Uses the BlobAccessor interface to compare the blobs. This will collate larger blobs higher than smaller blobs.
-
comparableTypes
public boolean comparableTypes(TType type)
Description copied from class:TTypeReturns true if the type of this object is logically comparable to the type of the given object. For example, VARCHAR and LONGVARCHAR are comparable types. DOUBLE and FLOAT are comparable types. DOUBLE and VARCHAR are not comparable types.- Specified by:
comparableTypesin classTType
-
compareObs
public int compareObs(java.lang.Object ob1, java.lang.Object ob2)Description copied from class:TTypeCompares two objects that are logically comparable under this type. Returns 0 if the values are equal, >1 if ob1 is greater than ob2, and <1 if ob1 is less than ob2. It is illegal to pass NULL values for ob1 or ob2 into this method.- Specified by:
compareObsin classTType
-
calculateApproximateMemoryUse
public int calculateApproximateMemoryUse(java.lang.Object ob)
Description copied from class:TTypeCalculates the approximate memory usage of an object of this type in bytes.- Specified by:
calculateApproximateMemoryUsein classTType
-
-