Class SQLSmallint

All Implemented Interfaces:
Externalizable, Serializable, Comparable, Formatable, Storable, TypedFormat, DataValueDescriptor, NumberDataValue, Orderable

public final class SQLSmallint extends NumberDataType
SQLSmallint satisfies the DataValueDescriptor interfaces (i.e., OrderableDataType). It implements a smallint column, e.g. for storing a column value; it can be specified when constructed to not allow nulls. Nullability cannot be changed after construction, as it affects the storage size and mechanism.

Because OrderableDataType is a subtype of ValueColumn, SQLSmallint can play a role in either a ValueColumn/Row or a OrderableDataType/Row, interchangeably.

We assume the store has a flag for nullness of the value, and simply return a 0-length array for the stored form when the value is null.

PERFORMANCE: There are likely alot of performance improvements possible for this implementation -- it new's Short more than it probably wants to.

See Also:
  • Field Details

    • SMALLINT_LENGTH

      static final int SMALLINT_LENGTH
      See Also:
    • BASE_MEMORY_USAGE

      private static final int BASE_MEMORY_USAGE
    • value

      private short value
    • isnull

      private boolean isnull
  • Constructor Details

    • SQLSmallint

      public SQLSmallint()
      No-arg constructor, required by Formattable. // This constructor also gets used when we are // allocating space for a short.
    • SQLSmallint

      public SQLSmallint(short val)
    • SQLSmallint

      private SQLSmallint(short val, boolean isnull)
    • SQLSmallint

      public SQLSmallint(Short obj)
  • Method Details