Package smile.data.type
Class DataTypes
java.lang.Object
smile.data.type.DataTypes
To get a specific data type, users should use singleton objects
and factory methods in this class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ArrayTypeBoolean Array data type.static final ObjectTypeBoolean Object data type.static final BooleanTypeBoolean data type.static final ArrayTypeByte Array data type.static final ObjectTypeByte Object data type.static final ByteTypeByte data type.static final ArrayTypeChar Array data type.static final ObjectTypeChar Object data type.static final CharTypeChar data type.static final DateTimeTypeDateTime data type with ISO format.static final DateTypeDate data type with ISO format.static final DecimalTypeDecimal data type.static final ArrayTypeDouble Array data type.static final ObjectTypeDouble Object data type.static final DoubleTypeDouble data type.static final ArrayTypeFloat Array data type.static final ObjectTypeFloat Object data type.static final FloatTypeFloat data type.static final ArrayTypeInteger Array data type.static final ObjectTypeInteger Object data type.static final IntegerTypeInteger data type.static final ArrayTypeLong Array data type.static final ObjectTypeLong Object data type.static final LongTypeLong data type.static final ObjectTypePlain Object data type.static final ArrayTypeShort Array data type.static final ObjectTypeShort Object data type.static final ShortTypeShort data type.static final StringTypeString data type.static final TimeTypeTime data type with ISO format. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayTypeCreates an array data type.static DateTypeDate data type with customized format.static DateTimeTypeDateTime data type with customized format.static DataTypeCreates an object data type of given class.static StructTypeCreates a struct data type from JDBC result set meta data.static StructTypestruct(ResultSetMetaData meta, String dbms) Creates a struct data type from JDBC result set meta data.static StructTypestruct(List<StructField> fields) Creates a struct data type.static StructTypestruct(StructField... fields) Creates a struct data type.static TimeTypeTime data type with customized format.
-
Field Details
-
BooleanType
Boolean data type. -
CharType
Char data type. -
ByteType
Byte data type. -
ShortType
Short data type. -
IntegerType
Integer data type. -
LongType
Long data type. -
FloatType
Float data type. -
DoubleType
Double data type. -
DecimalType
Decimal data type. -
StringType
String data type. -
DateType
Date data type with ISO format. -
DateTimeType
DateTime data type with ISO format. -
TimeType
Time data type with ISO format. -
ObjectType
Plain Object data type. -
BooleanObjectType
Boolean Object data type. -
CharObjectType
Char Object data type. -
ByteObjectType
Byte Object data type. -
ShortObjectType
Short Object data type. -
IntegerObjectType
Integer Object data type. -
LongObjectType
Long Object data type. -
FloatObjectType
Float Object data type. -
DoubleObjectType
Double Object data type. -
BooleanArrayType
Boolean Array data type. -
CharArrayType
Char Array data type. -
ByteArrayType
Byte Array data type. -
ShortArrayType
Short Array data type. -
IntegerArrayType
Integer Array data type. -
LongArrayType
Long Array data type. -
FloatArrayType
Float Array data type. -
DoubleArrayType
Double Array data type.
-
-
Constructor Details
-
DataTypes
public DataTypes()
-
-
Method Details
-
date
Date data type with customized format.- Parameters:
pattern- the date regex pattern.- Returns:
- the Date type.
-
time
Time data type with customized format.- Parameters:
pattern- the time regex pattern.- Returns:
- the Time type.
-
datetime
DateTime data type with customized format.- Parameters:
pattern- the date time regex pattern.- Returns:
- the DateTime type.
-
object
Creates an object data type of given class.- Parameters:
clazz- the object class.- Returns:
- the object data type.
-
array
Creates an array data type.- Parameters:
type- the data type of array elements.- Returns:
- the array data type.
-
struct
Creates a struct data type.- Parameters:
fields- the struct fields.- Returns:
- the struct data type.
-
struct
Creates a struct data type.- Parameters:
fields- the struct fields.- Returns:
- the struct data type.
-
struct
Creates a struct data type from JDBC result set meta data.- Parameters:
rs- the JDBC result set.- Returns:
- the struct data type.
- Throws:
SQLException- when JDBC operation fails.
-
struct
Creates a struct data type from JDBC result set meta data.- Parameters:
meta- the JDBC result set meta data.dbms- the name of database management system.- Returns:
- the struct data type.
- Throws:
SQLException- when JDBC operation fails.
-