com.jgpruitt.datamodeler.core
Class DataType

java.lang.Object
  extended by com.jgpruitt.datamodeler.core.DataType

public class DataType
extends java.lang.Object

This class functions as an enumeration of ANSI-SQL data types available for use in models. It can be extended in order to add data types for a particular platform.

Author:
John Pruitt

Field Summary
static DataType BIT
          Fixed-length array of binary bits.
static DataType CHAR
          Fixed-length character string.
static DataType DATE
          Date values.
static DataType DECIMAL
          Fixed-precision numbers.
static DataType DOUBLE
          Floating-point numbers.
static DataType FLOAT
          Floating-point numbers.
static DataType INT
          Whole numbers.
static DataType NCHAR
          Fixed-length character string supporting international character sets.
static DataType NUMERIC
          Fixed-precision numbers.
static DataType NVARCHAR
          Variable-length character string supporting international character sets.
static DataType REAL
          Floating-point numbers.
static DataType SMALLINT
          Whole numbers.
static DataType TIME
          Time values.
static DataType TIMESTAMP
          Date and time.
static DataType TIMESTAMPTZ
          Date and time with time-zone information.
static DataType TIMETZ
          Times with time-zone information.
static DataType VARCHAR
          Variable-length character string.
static DataType VBIT
          Variable-length array of binary bits.
 
Constructor Summary
protected DataType()
          The constructor should only be called internally, or by sub-classes.
 
Method Summary
 boolean isBIT()
          Is this the BIT instance?
 boolean isCHAR()
          Is this the CHAR instance?
 boolean isDATE()
          Is this the DATE instance?
 boolean isDECIMAL()
          Is this the DECIMAL instance?
 boolean isDOUBLE()
          Is this the DOUBLE instance?
 boolean isFLOAT()
          Is this the FLOAT instance?
 boolean isINT()
          Is this the INT instance?
 boolean isNCHAR()
          Is this the NCHAR instance?
 boolean isNUMERIC()
          Is this the NUMERIC instance?
 boolean isNVARCHAR()
          Is this the NVARCHAR instance?
 boolean isREAL()
          Is this the REAL instance?
 boolean isSMALLINT()
          Is this the SMALLINT instance?
 boolean isTIME()
          Is this the TIME instance?
 boolean isTIMESTAMP()
          Is this the TIMESTAMP instance?
 boolean isTIMESTAMPTZ()
          Is this the TIMESTAMPTZ instance?
 boolean isTIMETZ()
          Is this the TIMETZ instance?
 boolean isVARCHAR()
          Is this the VARCHAR instance?
 boolean isVBIT()
          Is this the VBIT instance?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHAR

public static final DataType CHAR
Fixed-length character string. CHAR ANSI-SQL datatype.


VARCHAR

public static final DataType VARCHAR
Variable-length character string. VARCHAR ANSI-SQL datatype.


NCHAR

public static final DataType NCHAR
Fixed-length character string supporting international character sets. NCHAR ANSI-SQL datatype.


NVARCHAR

public static final DataType NVARCHAR
Variable-length character string supporting international character sets. NVARCHAR ANSI-SQL datatype.


BIT

public static final DataType BIT
Fixed-length array of binary bits. BIT ANSI-SQL datatype.


VBIT

public static final DataType VBIT
Variable-length array of binary bits. VBIT ANSI-SQL datatype.


INT

public static final DataType INT
Whole numbers. INTEGER ANSI-SQL datatype.


SMALLINT

public static final DataType SMALLINT
Whole numbers. SMALLINT ANSI-SQL datatype.


FLOAT

public static final DataType FLOAT
Floating-point numbers. FLOAT ANSI-SQL datatype.


REAL

public static final DataType REAL
Floating-point numbers. REAL ANSI-SQL datatype.


DOUBLE

public static final DataType DOUBLE
Floating-point numbers. DOUBLE PRECISION ANSI-SQL datatype.


NUMERIC

public static final DataType NUMERIC
Fixed-precision numbers. NUMBERIC ANSI-SQL datatype.


DECIMAL

public static final DataType DECIMAL
Fixed-precision numbers. DECIMAL ANSI-SQL datatype.


DATE

public static final DataType DATE
Date values. DATE ANSI-SQL datatype.


TIME

public static final DataType TIME
Time values. TIME ANSI-SQL datatype.


TIMETZ

public static final DataType TIMETZ
Times with time-zone information. TIMETZ ANSI-SQL datatype.


TIMESTAMP

public static final DataType TIMESTAMP
Date and time. TIMESTAMP ANSI-SQL datatype.


TIMESTAMPTZ

public static final DataType TIMESTAMPTZ
Date and time with time-zone information. TIMESTAMPTZ ANSI-SQL datatype.

Constructor Detail

DataType

protected DataType()
The constructor should only be called internally, or by sub-classes.

Method Detail

isCHAR

public boolean isCHAR()
Is this the CHAR instance?

Returns:
true if equal

isVARCHAR

public boolean isVARCHAR()
Is this the VARCHAR instance?

Returns:
true if equal

isNCHAR

public boolean isNCHAR()
Is this the NCHAR instance?

Returns:
true if equal

isNVARCHAR

public boolean isNVARCHAR()
Is this the NVARCHAR instance?

Returns:
true if equal

isBIT

public boolean isBIT()
Is this the BIT instance?

Returns:
true if equal

isVBIT

public boolean isVBIT()
Is this the VBIT instance?

Returns:
true if equal

isINT

public boolean isINT()
Is this the INT instance?

Returns:
true if equal

isSMALLINT

public boolean isSMALLINT()
Is this the SMALLINT instance?

Returns:
true if equal

isFLOAT

public boolean isFLOAT()
Is this the FLOAT instance?

Returns:
true if equal

isREAL

public boolean isREAL()
Is this the REAL instance?

Returns:
true if equal

isDOUBLE

public boolean isDOUBLE()
Is this the DOUBLE instance?

Returns:
true if equal

isNUMERIC

public boolean isNUMERIC()
Is this the NUMERIC instance?

Returns:
true if equal

isDECIMAL

public boolean isDECIMAL()
Is this the DECIMAL instance?

Returns:
true if equal

isDATE

public boolean isDATE()
Is this the DATE instance?

Returns:
true if equal

isTIME

public boolean isTIME()
Is this the TIME instance?

Returns:
true if equal

isTIMETZ

public boolean isTIMETZ()
Is this the TIMETZ instance?

Returns:
true if equal

isTIMESTAMP

public boolean isTIMESTAMP()
Is this the TIMESTAMP instance?

Returns:
true if equal

isTIMESTAMPTZ

public boolean isTIMESTAMPTZ()
Is this the TIMESTAMPTZ instance?

Returns:
true if equal