com.mckoi.database
Class TNullType

java.lang.Object
  extended by com.mckoi.database.TType
      extended by com.mckoi.database.TNullType
All Implemented Interfaces:
java.io.Serializable

public class TNullType
extends TType

An implementation of TType that represents a NULL type. A Null type is an object that can't be anything else except null.

Author:
Tobias Downer
See Also:
Serialized Form

Field Summary
 
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
TNullType()
          Constructs the type.
 
Method Summary
 int calculateApproximateMemoryUse(java.lang.Object ob)
          Calculates the approximate memory usage of an object of this type in bytes.
 boolean comparableTypes(TType type)
          Returns true if the type of this object is logically comparable to the type of the given object.
 int compareObs(java.lang.Object ob1, java.lang.Object ob2)
          Compares two objects that are logically comparable under this type.
 java.lang.Class javaClass()
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TNullType

public TNullType()
Constructs the type.

Method Detail

comparableTypes

public boolean comparableTypes(TType type)
Description copied from class: TType
Returns 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:
comparableTypes in class TType

compareObs

public int compareObs(java.lang.Object ob1,
                      java.lang.Object ob2)
Description copied from class: TType
Compares 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:
compareObs in class TType

calculateApproximateMemoryUse

public int calculateApproximateMemoryUse(java.lang.Object ob)
Description copied from class: TType
Calculates the approximate memory usage of an object of this type in bytes.

Specified by:
calculateApproximateMemoryUse in class TType

javaClass

public java.lang.Class javaClass()
Description copied from class: TType
Returns the Java Class that is used to represent this type of object. For example, string types would return String.class.

Specified by:
javaClass in class TType