public class ColumnImpl extends Object implements Column, Comparable<ColumnImpl>
Modifier and Type | Class and Description |
---|---|
class |
ColumnImpl.AutoNumberGenerator
Base class for the supported autonumber types.
|
static class |
ColumnImpl.SortOrder
Information about the sort order (collation) for a textual column.
|
Modifier and Type | Field and Description |
---|---|
static byte |
AUTO_NUMBER_FLAG_MASK
mask for the auto number bit
|
static byte |
AUTO_NUMBER_GUID_FLAG_MASK
mask for the auto number guid bit
|
static LocalDate |
BASE_LD |
static LocalDateTime |
BASE_LDT |
static LocalTime |
BASE_LT |
static byte |
FIXED_LEN_FLAG_MASK
mask for the fixed len bit
|
static ColumnImpl.SortOrder |
GENERAL_97_SORT_ORDER
the "general" text sort order, version (access 1997)
|
static ColumnImpl.SortOrder |
GENERAL_LEGACY_SORT_ORDER
the "general" text sort order, legacy version (access 2000-2007)
|
static ColumnImpl.SortOrder |
GENERAL_SORT_ORDER
the "general" text sort order, latest version (access 2010+)
|
static byte |
HYPERLINK_FLAG_MASK
mask for the hyperlink bit (on memo types)
|
static Object |
RETURN_ROW_ID
Placeholder object for adding rows which indicates that the caller wants
the RowId of the new row.
|
static byte |
UPDATABLE_FLAG_MASK
mask for the "is updatable" field bit
|
AUTO_NUMBER, KEEP_VALUE
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ColumnImpl other)
Orders Columns by column number.
|
static short |
countVariableLength(List<ColumnBuilder> columns) |
static ColumnImpl |
create(TableImpl table,
ByteBuffer buffer,
int offset,
String name,
int displayIndex)
Creates the appropriate ColumnImpl class and reads a column definition in
from a buffer
|
static String |
decodeUncompressedText(byte[] textBytes,
Charset charset) |
static ByteBuffer |
encodeUncompressedText(CharSequence text,
Charset charset) |
long |
fromDateDouble(double value)
Returns a java long time value converted from an access date double.
|
Object |
generateDefaultValue()
Returns a default value for this column
|
ColumnImpl.AutoNumberGenerator |
getAutoNumberGenerator()
Returns the AutoNumberGenerator for this column if this is an autonumber
column,
null otherwise. |
int |
getColumnIndex() |
short |
getColumnNumber() |
ColumnValidator |
getColumnValidator()
Gets currently configured ColumnValidator (always non-
null ). |
ComplexColumnInfo<? extends ComplexValue> |
getComplexInfo()
Returns extended functionality for "complex" columns.
|
DatabaseImpl |
getDatabase() |
com.healthmarketscience.jackcess.impl.ColumnImpl.DateTimeFactory |
getDateTimeFactory() |
int |
getDisplayIndex() |
int |
getFixedDataOffset() |
JetFormat |
getFormat() |
short |
getLength() |
short |
getLengthInUnits() |
String |
getName() |
int |
getOwnedPageCount()
Returns the number of database pages owned by this column.
|
PageChannel |
getPageChannel() |
byte |
getPrecision() |
PropertyMap |
getProperties() |
Object |
getRowValue(Map<String,?> rowMap) |
Object |
getRowValue(Object[] rowArray) |
byte |
getScale() |
int |
getSQLType() |
TableImpl |
getTable() |
short |
getTextCodePage() |
ColumnImpl.SortOrder |
getTextSortOrder() |
TimeZone |
getTimeZone() |
DataType |
getType() |
int |
getVarLenTableIndex() |
ColumnImpl |
getVersionHistoryColumn()
Returns the column which tracks the version history for an "append only"
column.
|
ZoneId |
getZoneId() |
boolean |
isAppendOnly()
Whether or not this column is "append only" (its history is tracked by a
separate version history column).
|
boolean |
isAutoNumber() |
boolean |
isCalculated()
Returns whether or not this is a calculated column.
|
boolean |
isCompressedUnicode() |
boolean |
isHyperlink()
Returns whether or not this is a hyperlink column (only possible for
columns of type MEMO).
|
static boolean |
isRawData(Object value)
Returns
true if the given value is "raw" column data,
false otherwise. |
boolean |
isVariableLength() |
static LocalDateTime |
ldtFromLocalDateDouble(double value) |
static com.healthmarketscience.jackcess.impl.ColumnImpl.RawData |
rawDataWrapper(byte[] bytes)
Returns a wrapper for raw column data that can be written without
understanding the data.
|
Object |
read(byte[] data)
Deserialize a raw byte value for this column into an Object
|
Object |
read(byte[] data,
ByteOrder order)
Deserialize a raw byte value for this column into an Object
|
Object |
readFromNullMask(boolean isNull) |
void |
setColumnIndex(int newColumnIndex) |
void |
setColumnValidator(ColumnValidator newValidator)
Sets a new ColumnValidator.
|
Object |
setRowValue(Map<String,Object> rowMap,
Object value) |
Object |
setRowValue(Object[] rowArray,
Object value) |
void |
setVersionHistoryColumn(ColumnImpl versionHistoryCol) |
boolean |
storeInNullMask() |
static boolean |
toBooleanValue(Object obj)
Interpret a boolean value (null == false)
|
static byte[] |
toByteArray(Object value) |
static CharSequence |
toCharSequence(Object value) |
static double |
toDateDouble(LocalDateTime ldt) |
double |
toDateDouble(Object value)
Returns an access date double converted from a java Date/Calendar/Number
time value.
|
static Object |
toInternalValue(DataType dataType,
Object value,
DatabaseImpl db)
Converts the given value to the "internal" representation for the given
data type.
|
String |
toString() |
Object |
validate(Object obj)
Passes the given obj through the currently configured validator for this
column and returns the result.
|
ByteBuffer |
write(Object obj,
int remainingRowLength)
Serialize an Object into a raw byte value for this column in little
endian order
|
ByteBuffer |
write(Object obj,
int remainingRowLength,
ByteOrder order)
Serialize an Object into a raw byte value for this column
|
boolean |
writeToNullMask(Object value) |
public static final Object RETURN_ROW_ID
TableImpl.asRowWithRowId(java.util.Map<java.lang.String, ?>)
public static final LocalDate BASE_LD
public static final LocalTime BASE_LT
public static final LocalDateTime BASE_LDT
public static final byte FIXED_LEN_FLAG_MASK
public static final byte AUTO_NUMBER_FLAG_MASK
public static final byte AUTO_NUMBER_GUID_FLAG_MASK
public static final byte HYPERLINK_FLAG_MASK
public static final byte UPDATABLE_FLAG_MASK
public static final ColumnImpl.SortOrder GENERAL_97_SORT_ORDER
public static final ColumnImpl.SortOrder GENERAL_LEGACY_SORT_ORDER
public static final ColumnImpl.SortOrder GENERAL_SORT_ORDER
public static ColumnImpl create(TableImpl table, ByteBuffer buffer, int offset, String name, int displayIndex) throws IOException
table
- owning tablebuffer
- Buffer containing column definitionoffset
- Offset in the buffer at which the column definition startsIOException
public DatabaseImpl getDatabase()
getDatabase
in interface Column
public JetFormat getFormat()
public PageChannel getPageChannel()
public boolean isVariableLength()
isVariableLength
in interface Column
public boolean isAutoNumber()
isAutoNumber
in interface Column
public short getColumnNumber()
public int getColumnIndex()
getColumnIndex
in interface Column
public void setColumnIndex(int newColumnIndex)
public int getDisplayIndex()
public int getSQLType() throws IOException
getSQLType
in interface Column
IOException
public boolean isCompressedUnicode()
isCompressedUnicode
in interface Column
public byte getPrecision()
getPrecision
in interface Column
public ColumnImpl.SortOrder getTextSortOrder()
public short getTextCodePage()
public final short getLengthInUnits()
getLengthInUnits
in interface Column
public boolean isCalculated()
Column
isCalculated
in interface Column
public int getVarLenTableIndex()
public int getFixedDataOffset()
public TimeZone getTimeZone()
public ZoneId getZoneId()
public com.healthmarketscience.jackcess.impl.ColumnImpl.DateTimeFactory getDateTimeFactory()
public boolean isAppendOnly()
Column
isAppendOnly
in interface Column
public ColumnImpl getVersionHistoryColumn()
Column
getVersionHistoryColumn
in interface Column
public int getOwnedPageCount()
public void setVersionHistoryColumn(ColumnImpl versionHistoryCol)
public boolean isHyperlink()
Column
isHyperlink
in interface Column
public ComplexColumnInfo<? extends ComplexValue> getComplexInfo()
Column
getComplexInfo
in interface Column
public ColumnValidator getColumnValidator()
Column
null
).getColumnValidator
in interface Column
public void setColumnValidator(ColumnValidator newValidator)
Column
null
, resets to the value
returned from the Database's ColumnValidatorFactory (if the factory
returns null
, then the default is used). Autonumber columns
cannot have a validator instance other than the default.setColumnValidator
in interface Column
public ColumnImpl.AutoNumberGenerator getAutoNumberGenerator()
null
otherwise.public PropertyMap getProperties() throws IOException
getProperties
in interface Column
IOException
public Object setRowValue(Object[] rowArray, Object value)
setRowValue
in interface Column
public Object setRowValue(Map<String,Object> rowMap, Object value)
setRowValue
in interface Column
public Object getRowValue(Object[] rowArray)
getRowValue
in interface Column
public Object getRowValue(Map<String,?> rowMap)
getRowValue
in interface Column
public boolean storeInNullMask()
public boolean writeToNullMask(Object value)
public Object readFromNullMask(boolean isNull)
public Object read(byte[] data) throws IOException
data
- The raw byte valueIOException
public Object read(byte[] data, ByteOrder order) throws IOException
data
- The raw byte valueorder
- Byte order in which the raw value is storedIOException
public long fromDateDouble(double value)
public static LocalDateTime ldtFromLocalDateDouble(double value)
public double toDateDouble(Object value) throws InvalidValueException
InvalidValueException
public static double toDateDouble(LocalDateTime ldt)
public Object generateDefaultValue() throws IOException
IOException
public Object validate(Object obj) throws IOException
IOException
public ByteBuffer write(Object obj, int remainingRowLength) throws IOException
obj
- Object to serializeIOException
public ByteBuffer write(Object obj, int remainingRowLength, ByteOrder order) throws IOException
obj
- Object to serializeorder
- Order in which to serializeIOException
public static String decodeUncompressedText(byte[] textBytes, Charset charset)
textBytes
- bytes of text to decodecharset
- relevant charsetpublic static ByteBuffer encodeUncompressedText(CharSequence text, Charset charset)
text
- Text to encodecharset
- database charsetpublic int compareTo(ColumnImpl other)
compareTo
in interface Comparable<ColumnImpl>
public static short countVariableLength(List<ColumnBuilder> columns)
columns
- A list of columns in a table definitionpublic static CharSequence toCharSequence(Object value) throws IOException
IOException
public static byte[] toByteArray(Object value) throws IOException
IOException
public static boolean toBooleanValue(Object obj)
public static com.healthmarketscience.jackcess.impl.ColumnImpl.RawData rawDataWrapper(byte[] bytes)
public static boolean isRawData(Object value)
true
if the given value is "raw" column data,
false
otherwise.public static Object toInternalValue(DataType dataType, Object value, DatabaseImpl db) throws IOException
IOException
Copyright © 2005–2024 OpenHMS. All rights reserved.