|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.healthmarketscience.jackcess.impl.ColumnImpl
public class ColumnImpl
Access database column definition
| Nested Class Summary | |
|---|---|
class |
ColumnImpl.AutoNumberGenerator
Base class for the supported autonumber types. |
static class |
ColumnImpl.SortOrder
Information about the sort order (collation) for a textual column. |
| Field Summary | |
|---|---|
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 byte |
FIXED_LEN_FLAG_MASK
mask for the fixed len bit |
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 |
UNKNOWN_FLAG_MASK
mask for the unknown bit (possible "can be null"?) |
| Fields inherited from interface com.healthmarketscience.jackcess.Column |
|---|
AUTO_NUMBER, KEEP_VALUE |
| Constructor Summary | |
|---|---|
ColumnImpl(TableImpl table,
ByteBuffer buffer,
int offset,
int displayIndex)
Read a column definition in from a buffer |
|
| Method Summary | |
|---|---|
int |
compareTo(ColumnImpl other)
Orders Columns by column number. |
static short |
countNonLongVariableLength(List<ColumnBuilder> columns)
|
static short |
countVariableLength(List<ColumnBuilder> columns)
|
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. |
ColumnImpl.AutoNumberGenerator |
getAutoNumberGenerator()
Returns the AutoNumberGenerator for this column if this is an autonumber column, null otherwise. |
int |
getColumnIndex()
|
short |
getColumnNumber()
|
ComplexColumnInfo<? extends ComplexValue> |
getComplexInfo()
Returns extended functionality for "complex" columns. |
DatabaseImpl |
getDatabase()
|
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()
|
DataType |
getType()
|
int |
getVarLenTableIndex()
|
ColumnImpl |
getVersionHistoryColumn()
Returns the column which tracks the version history for an "append only" column. |
boolean |
isAppendOnly()
Whether or not this column is "append only" (its history is tracked by a separate version history column). |
boolean |
isAutoNumber()
|
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)
Returs true if the given value is "raw" column data,
false otherwise. |
boolean |
isVariableLength()
|
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 |
void |
setColumnIndex(int newColumnIndex)
|
void |
setName(String name)
|
Object |
setRowValue(Map<String,Object> rowMap,
Object value)
|
Object |
setRowValue(Object[] rowArray,
Object value)
|
void |
setVersionHistoryColumn(ColumnImpl versionHistoryCol)
|
static boolean |
toBooleanValue(Object obj)
Interpret a boolean value (null == false) |
static byte[] |
toByteArray(Object value)
|
static CharSequence |
toCharSequence(Object value)
|
double |
toDateDouble(Object value)
Returns an access date double converted from a java Date/Calendar/Number time value. |
String |
toString()
|
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 |
ByteBuffer |
writeFixedLengthField(Object obj,
ByteOrder order)
Serialize an Object into a raw byte value for this column |
ByteBuffer |
writeLongValue(byte[] value,
int remainingRowLength)
Write an LVAL column into a ByteBuffer inline if it fits, otherwise in other data page(s). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Object RETURN_ROW_ID
TableImpl.asRowWithRowId(java.util.Map) 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 UNKNOWN_FLAG_MASK
public static final ColumnImpl.SortOrder GENERAL_LEGACY_SORT_ORDER
public static final ColumnImpl.SortOrder GENERAL_SORT_ORDER
| Constructor Detail |
|---|
public ColumnImpl(TableImpl table,
ByteBuffer buffer,
int offset,
int displayIndex)
throws IOException
table - owning tablebuffer - Buffer containing column definitionoffset - Offset in the buffer at which the column definition starts
IOException| Method Detail |
|---|
public TableImpl getTable()
getTable in interface Columnpublic DatabaseImpl getDatabase()
getDatabase in interface Columnpublic JetFormat getFormat()
public PageChannel getPageChannel()
public String getName()
getName in interface Columnpublic void setName(String name)
public boolean isVariableLength()
isVariableLength in interface Columnpublic boolean isAutoNumber()
isAutoNumber in interface Columnpublic short getColumnNumber()
public int getColumnIndex()
getColumnIndex in interface Columnpublic void setColumnIndex(int newColumnIndex)
public int getDisplayIndex()
public DataType getType()
getType in interface Column
public int getSQLType()
throws SQLException
getSQLType in interface ColumnSQLExceptionpublic boolean isCompressedUnicode()
isCompressedUnicode in interface Columnpublic byte getPrecision()
getPrecision in interface Columnpublic byte getScale()
getScale in interface Columnpublic ColumnImpl.SortOrder getTextSortOrder()
public short getTextCodePage()
public short getLength()
getLength in interface Columnpublic short getLengthInUnits()
getLengthInUnits in interface Columnpublic int getVarLenTableIndex()
public int getFixedDataOffset()
public boolean isAppendOnly()
Column
isAppendOnly in interface Columnpublic ColumnImpl getVersionHistoryColumn()
Column
getVersionHistoryColumn in interface Columnpublic int getOwnedPageCount()
public void setVersionHistoryColumn(ColumnImpl versionHistoryCol)
public boolean isHyperlink()
Column
isHyperlink in interface Columnpublic ComplexColumnInfo<? extends ComplexValue> getComplexInfo()
Column
getComplexInfo in interface Columnpublic ColumnImpl.AutoNumberGenerator getAutoNumberGenerator()
null otherwise.
public PropertyMap getProperties()
throws IOException
getProperties in interface ColumnIOException
public Object setRowValue(Object[] rowArray,
Object value)
setRowValue in interface Column
public Object setRowValue(Map<String,Object> rowMap,
Object value)
setRowValue in interface Columnpublic Object getRowValue(Object[] rowArray)
getRowValue in interface Columnpublic Object getRowValue(Map<String,?> rowMap)
getRowValue in interface Column
public Object read(byte[] data)
throws IOException
data - The raw byte value
IOException
public Object read(byte[] data,
ByteOrder order)
throws IOException
data - The raw byte valueorder - Byte order in which the raw value is stored
IOExceptionpublic long fromDateDouble(double value)
public double toDateDouble(Object value)
public ByteBuffer writeLongValue(byte[] value,
int remainingRowLength)
throws IOException
value - Value of the LVAL column
IOException
public ByteBuffer write(Object obj,
int remainingRowLength)
throws IOException
obj - Object to serialize
IOException
public ByteBuffer write(Object obj,
int remainingRowLength,
ByteOrder order)
throws IOException
obj - Object to serializeorder - Order in which to serialize
IOException
public ByteBuffer writeFixedLengthField(Object obj,
ByteOrder order)
throws IOException
obj - Object to serializeorder - Order in which to serialize
IOExceptionpublic String toString()
toString in class Object
public static String decodeUncompressedText(byte[] textBytes,
Charset charset)
textBytes - bytes of text to decodecharset - relevant charset
public static ByteBuffer encodeUncompressedText(CharSequence text,
Charset charset)
text - Text to encodecharset - database charset
public int compareTo(ColumnImpl other)
compareTo in interface Comparable<ColumnImpl>public static short countVariableLength(List<ColumnBuilder> columns)
columns - A list of columns in a table definition
public static short countNonLongVariableLength(List<ColumnBuilder> columns)
columns - A list of columns in a table definition
public static CharSequence toCharSequence(Object value)
throws IOException
IOException
public static byte[] toByteArray(Object value)
throws IOException
IOExceptionpublic static boolean toBooleanValue(Object obj)
public static boolean isRawData(Object value)
true if the given value is "raw" column data,
false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||