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 returnedcolumnto theBooleanTypeinterface or to theSimpleTypeclass.- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theByteTypeinterface or to theSimpleTypeclass.- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theShortTypeinterface or to theSimpleTypeclass.- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theIntegerTypeinterface or to theSimpleTypeclass.- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theLongTypeinterface or to theSimpleTypeclass.- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theFloatTypeinterface or to theSimpleTypeclass.- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theDoubleTypeinterface or to theSimpleTypeclass.- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theStringTypeinterface or to theSimpleTypeclass.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 returnedcolumnto theStringTypeinterface or to theSimpleTypeclass.Invoking this method has the same effect as invoking
ofString(StandardCharsets.UTF_8, nulls, length).- Parameters:
nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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 returnedcolumnto theStringTypeinterface or to theSimpleTypeclass.- Parameters:
charset- TheCharsetto be used to encode a string value, not allowed to benull.nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif not.length- The length of the string.- Returns:
- The created column of type String.
- Throws:
NullPointerException- Ifcharsetisnull.
-
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 returnedcolumnto theStringTypeinterface or to theSimpleTypeclass.- Parameters:
charset- TheCharsetto be used to encode a string value, not allowed to benull.nulls- Must be set toNulls.NULLABLEif the type allows thenullvalue,Nulls.NO_NULLif 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- Ifcharsetisnull.IllegalArgumentException- Iflengthis 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
typemethods 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- IfsimpleTypeisnull.
-
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 returnedcolumnto theArrayTypeinterface.Consider using the
STsimple column type factory if the element type should be a built-in simple column type. If you are not using theSTsimple 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- IfelementTypeisnull.IllegalArgumentException- IfmaxSizeis 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 returnedcolumnto theArrayTypeinterface.Consider using the
STsimple column type factory if the element type should be a built-in simple column type. If you are not using theSTsimple 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- IfschemeorelementTypeisnull.IllegalArgumentException- IfmaxSizeis less than 1.
-
ofRef
Creates a new column having the reference column type. It is safe to castcolumn.info().type()of the returnedcolumnto theRefTypeinterface.- 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 returnedcolumnto theArrayOfRefTypeinterface.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- IfmaxSizeis 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 returnedcolumnto theArrayOfRefTypeinterface.- 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- Ifschemeisnull.IllegalArgumentException- IfmaxSizeis less than 1.
-