Class CL
- Author:
- Beat Hörmann
-
Method Summary
Modifier and TypeMethodDescriptionstatic final <T> Column<T>
create
(SimpleType<T> simpleType) Creates a new column having the specified simple column type.static final <T> Column<T[]>
ofArray
(int maxSize, SimpleType<T> elementType) Creates a new column of type array with an outrow storage scheme and with elements of the specified element type.static final <T> Column<T[]>
ofArray
(Type.Scheme scheme, int maxSize, SimpleType<T> elementType) Creates a new column of type array with elements of the specified element type.ofArrayOfRef
(int maxSize) Creates a new column having an array of references column type with an outrow storage scheme.ofArrayOfRef
(Type.Scheme scheme, int maxSize) Creates a new column having an array of references column type.Creates a new column of type Boolean.Creates a new column of type Byte.Creates a new column of type Double.Creates a new column of type Float.Creates a new column of type Integer.Creates a new column of type Long.ofRef()
Creates a new column having the reference column type.Creates a new column of type Short.ofString()
Creates a new column of type "classic Java" String.ofString
(ST.Nulls nulls, ST.OutrowStringLength length) Creates a new column of type String with an outrow storage scheme and applying the "UTF-8" charset for any byte conversions.Creates a new column of type String with an inrow storage scheme and applying the specified charset for any byte conversions.ofString
(Charset charset, ST.Nulls nulls, ST.OutrowStringLength length) Creates a new column of type String with an outrow storage scheme and applying the specified charset for any byte conversions.
-
Method Details
-
ofBoolean
Creates a new column of type Boolean. It is safe to castcolumn.info().type()
of the returnedcolumn
to theBooleanType
interface or to theSimpleType
class.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The created column of type Boolean.
-
ofByte
Creates a new column of type Byte. It is safe to castcolumn.info().type()
of the returnedcolumn
to theByteType
interface or to theSimpleType
class.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The created column of type Byte.
-
ofShort
Creates a new column of type Short. It is safe to castcolumn.getInfo().type()
of the returnedcolumn
to theShortType
interface or to theSimpleType
class.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The created column of type Short.
-
ofInteger
Creates a new column of type Integer. It is safe to castcolumn.info().type()
of the returnedcolumn
to theIntegerType
interface or to theSimpleType
class.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The created column of type Integer.
-
ofLong
Creates a new column of type Long. It is safe to castcolumn.info().type()
of the returnedcolumn
to theLongType
interface or to theSimpleType
class.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The created column of type Long.
-
ofFloat
Creates a new column of type Float. It is safe to castcolumn.info().type()
of the returnedcolumn
to theFloatType
interface or to theSimpleType
class.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The created column of type Float.
-
ofDouble
Creates a new column of type Double. It is safe to castcolumn.info().type()
of the returnedcolumn
to theDoubleType
interface or to theSimpleType
class.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.- Returns:
- The created column of type Double.
-
ofString
Creates a new column of type "classic Java" String. It is safe to castcolumn.info().type()
of the returnedcolumn
to theStringType
interface or to theSimpleType
class.Invoking this method has the same effect as invoking
ofString(Nulls.NULLABLE, OutrowStringLength.GIANT)
.- Returns:
- The created column of type String.
-
ofString
Creates a new column of type String with an outrow storage scheme and applying the "UTF-8" charset for any byte conversions. It is safe to castcolumn.info().type()
of the returnedcolumn
to theStringType
interface or to theSimpleType
class.Invoking this method has the same effect as invoking
ofString(StandardCharsets.UTF_8, nulls, length)
.- Parameters:
nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.length
- The length of the string.- Returns:
- The created column of type String.
-
ofString
public static final Column<String> ofString(Charset charset, ST.Nulls nulls, ST.OutrowStringLength length) throws NullPointerException Creates a new column of type String with an outrow storage scheme and applying the specified charset for any byte conversions. It is safe to castcolumn.info().type()
of the returnedcolumn
to theStringType
interface or to theSimpleType
class.- Parameters:
charset
- TheCharset
to be used to encode a string value, not allowed to benull
.nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.length
- The length of the string.- Returns:
- The created column of type String.
- Throws:
NullPointerException
- Ifcharset
isnull
.
-
ofString
public static final Column<String> ofString(Charset charset, ST.Nulls nulls, int length) throws NullPointerException, IllegalArgumentException Creates a new column of type String with an inrow storage scheme and applying the specified charset for any byte conversions. It is safe to castcolumn.info().type()
of the returnedcolumn
to theStringType
interface or to theSimpleType
class.- Parameters:
charset
- TheCharset
to be used to encode a string value, not allowed to benull
.nulls
- Must be set toNulls.NULLABLE
if the type allows thenull
value,Nulls.NO_NULL
if not.length
- The maximum number of characters of the String, must be greater than or equal to 1 and less than or equal toInteger.MAX_VALUE
- 4. Depending on the character set the maximum number of characters may be less than this value.- Returns:
- The created column of type String.
- Throws:
NullPointerException
- Ifcharset
isnull
.IllegalArgumentException
- Iflength
is less than 1 or greater thanInteger.MAX_VALUE
- 4.
-
create
Creates a new column having the specified simple column type.This method is typically used if the column type is a custom column type, hence, if the column can't be created with one of the
type
methods of this class.Note that the type of the returned column may not be identical (
==
) to the specified column type but the type descriptors will be equal (String.equals
). This is because ACDP internally treats column types with same type descriptors as singletons.- Type Parameters:
T
- The type of the column's values.- Parameters:
simpleType
- The simple column type, not allowed to benull
.- Returns:
- The created column having the specified simple type.
- Throws:
NullPointerException
- IfsimpleType
isnull
.
-
ofArray
public static final <T> Column<T[]> ofArray(int maxSize, SimpleType<T> elementType) throws NullPointerException, IllegalArgumentException Creates a new column of type array with an outrow storage scheme and with elements of the specified element type. It is safe to castcolumn.info().type()
of the returnedcolumn
to theArrayType
interface.Consider using the
ST
simple column type factory if the element type should be a built-in simple column type. If you are not using theST
simple column type factory then note that the element type of the returned array column may not be identical (==
) to the specified element type but the type descriptors will be equal (String.equals
). This is because ACDP internally handles column types with same type descriptors as singletons.Invoking this method has the same effect as invoking
ofArray(Scheme.OUTROW, maxSize, elementType)
.- Type Parameters:
T
- The type of the elements.- Parameters:
maxSize
- The maximum number of elements in an array value of this array type.elementType
- The type of the elements of the array, not allowed to benull
.- Returns:
- The created array type column.
- Throws:
NullPointerException
- IfelementType
isnull
.IllegalArgumentException
- IfmaxSize
is less than 1.
-
ofArray
public static final <T> Column<T[]> ofArray(Type.Scheme scheme, int maxSize, SimpleType<T> elementType) throws NullPointerException, IllegalArgumentException Creates a new column of type array with elements of the specified element type. It is safe to castcolumn.info().type()
of the returnedcolumn
to theArrayType
interface.Consider using the
ST
simple column type factory if the element type should be a built-in simple column type. If you are not using theST
simple column type factory then note that the element type of the returned array column may not be identical (==
) to the specified element type but the type descriptors will be equal (String.equals
). This is because ACDP internally handles column types with same type descriptors as singletons.- Type Parameters:
T
- The type of the elements.- Parameters:
scheme
- The storage scheme of the type, not allowed to benull
.maxSize
- The maximum number of elements in an array value of this array type.elementType
- The type of the elements of the array, not allowed to benull
.- Returns:
- The created array type column.
- Throws:
NullPointerException
- Ifscheme
orelementType
isnull
.IllegalArgumentException
- IfmaxSize
is less than 1.
-
ofRef
Creates a new column having the reference column type. It is safe to castcolumn.info().type()
of the returnedcolumn
to theRefType
interface.- Returns:
- The created column.
-
ofArrayOfRef
Creates a new column having an array of references column type with an outrow storage scheme. It is safe to castcolumn.info().type()
of the returnedcolumn
to theArrayOfRefType
interface.Invoking this method has the same effect as invoking
ofArrayOfRef(Scheme.OUTROW, maxSize)
.- Parameters:
maxSize
- The maximum number of elements in an array value of this array type.- Returns:
- The created column of type array with elements being references.
- Throws:
IllegalArgumentException
- IfmaxSize
is less than 1.
-
ofArrayOfRef
public static final Column<Ref[]> ofArrayOfRef(Type.Scheme scheme, int maxSize) throws NullPointerException, IllegalArgumentException Creates a new column having an array of references column type. It is safe to castcolumn.info().type()
of the returnedcolumn
to theArrayOfRefType
interface.- Parameters:
scheme
- The storage scheme of the type, not allowed to benull
.maxSize
- The maximum number of elements in an array value of this array type.- Returns:
- The created column of type array with elements being references.
- Throws:
NullPointerException
- Ifscheme
isnull
.IllegalArgumentException
- IfmaxSize
is less than 1.
-