|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.healthmarketscience.jackcess.Column
public class Column
Access database column definition
| Nested Class Summary | |
|---|---|
class |
Column.AutoNumberGenerator
Base class for the supported autonumber types. |
static class |
Column.SortOrder
Information about the sort order (collation) for a textual column. |
| Field Summary | |
|---|---|
static Object |
AUTO_NUMBER
Meaningless placeholder object for inserting values in an autonumber column. |
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 Column.SortOrder |
GENERAL_LEGACY_SORT_ORDER
the "general" text sort order, legacy version (access 2000-2007) |
static Column.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 |
KEEP_VALUE
Meaningless placeholder object for updating rows which indicates that a given column should keep its existing value. |
static byte |
UNKNOWN_FLAG_MASK
mask for the unknown bit (possible "can be null"?) |
| Constructor Summary | |
|---|---|
Column()
|
|
Column(JetFormat format)
|
|
Column(Table table,
ByteBuffer buffer,
int offset,
int displayIndex)
Read a column definition in from a buffer |
|
| Method Summary | |
|---|---|
int |
compareTo(Column other)
Orders Columns by column number. |
static short |
countNonLongVariableLength(List<Column> columns)
|
static short |
countVariableLength(List<Column> columns)
|
static String |
decodeUncompressedText(byte[] textBytes,
Charset charset)
|
static ByteBuffer |
encodeUncompressedText(CharSequence text,
Charset charset)
|
Column.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. |
Database |
getDatabase()
|
int |
getDisplayIndex()
|
int |
getFixedDataOffset()
|
JetFormat |
getFormat()
|
short |
getLength()
|
short |
getLengthInUnits()
|
String |
getName()
|
PageChannel |
getPageChannel()
|
byte |
getPrecision()
|
PropertyMap |
getProperties()
|
Object |
getRowValue(Map<String,?> rowMap)
|
Object |
getRowValue(Object[] rowArray)
|
byte |
getScale()
|
int |
getSQLType()
|
Table |
getTable()
|
short |
getTextCodePage()
|
Column.SortOrder |
getTextSortOrder()
|
DataType |
getType()
|
int |
getVarLenTableIndex()
|
Column |
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). |
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 |
setAutoNumber(boolean autoNumber)
|
void |
setColumnIndex(int newColumnIndex)
|
void |
setColumnNumber(short newColumnNumber)
|
void |
setCompressedUnicode(boolean newCompessedUnicode)
|
void |
setFixedDataOffset(int newOffset)
|
void |
setHyperlink(boolean hyperlink)
|
void |
setLength(short length)
|
void |
setLengthInUnits(short unitLength)
|
void |
setName(String name)
|
void |
setPrecision(byte newPrecision)
|
Object |
setRowValue(Map<String,Object> rowMap,
Object value)
|
Object |
setRowValue(Object[] rowArray,
Object value)
|
void |
setScale(byte newScale)
|
void |
setSQLType(int type)
|
void |
setSQLType(int type,
int lengthInUnits)
|
void |
setTextSortOrder(Column.SortOrder newTextSortOrder)
|
void |
setType(DataType type)
Also sets the length and the variable length flag, inferred from the type. |
void |
setVariableLength(boolean variableLength)
|
void |
setVarLenTableIndex(int idx)
|
void |
setVersionHistoryColumn(Column versionHistoryCol)
|
static boolean |
toBooleanValue(Object obj)
Interpret a boolean value (null == false) |
static byte[] |
toByteArray(Object value)
|
static CharSequence |
toCharSequence(Object value)
|
String |
toString()
|
void |
validate(JetFormat format)
Checks that this column definition is valid. |
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 AUTO_NUMBER
public static final Object KEEP_VALUE
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 Column.SortOrder GENERAL_LEGACY_SORT_ORDER
public static final Column.SortOrder GENERAL_SORT_ORDER
| Constructor Detail |
|---|
public Column()
public Column(JetFormat format)
public Column(Table 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 Table getTable()
public Database getDatabase()
public JetFormat getFormat()
public PageChannel getPageChannel()
public String getName()
public void setName(String name)
public boolean isVariableLength()
public void setVariableLength(boolean variableLength)
public boolean isAutoNumber()
public void setAutoNumber(boolean autoNumber)
public short getColumnNumber()
public void setColumnNumber(short newColumnNumber)
public int getColumnIndex()
public void setColumnIndex(int newColumnIndex)
public int getDisplayIndex()
public void setType(DataType type)
public DataType getType()
public int getSQLType()
throws SQLException
SQLException
public void setSQLType(int type)
throws SQLException
SQLException
public void setSQLType(int type,
int lengthInUnits)
throws SQLException
SQLExceptionpublic boolean isCompressedUnicode()
public void setCompressedUnicode(boolean newCompessedUnicode)
public byte getPrecision()
public void setPrecision(byte newPrecision)
public byte getScale()
public void setScale(byte newScale)
public Column.SortOrder getTextSortOrder()
public void setTextSortOrder(Column.SortOrder newTextSortOrder)
public short getTextCodePage()
public void setLength(short length)
public short getLength()
public void setLengthInUnits(short unitLength)
public short getLengthInUnits()
public void setVarLenTableIndex(int idx)
public int getVarLenTableIndex()
public void setFixedDataOffset(int newOffset)
public int getFixedDataOffset()
public boolean isAppendOnly()
public Column getVersionHistoryColumn()
public void setVersionHistoryColumn(Column versionHistoryCol)
public boolean isHyperlink()
public void setHyperlink(boolean hyperlink)
public ComplexColumnInfo<? extends ComplexValue> getComplexInfo()
public Column.AutoNumberGenerator getAutoNumberGenerator()
null otherwise.
public PropertyMap getProperties()
throws IOException
IOExceptionpublic void validate(JetFormat format)
IllegalArgumentException - if this column definition is invalid.
public Object setRowValue(Object[] rowArray,
Object value)
public Object setRowValue(Map<String,Object> rowMap,
Object value)
public Object getRowValue(Object[] rowArray)
public Object getRowValue(Map<String,?> rowMap)
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
IOException
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(Column other)
compareTo in interface Comparable<Column>public static short countVariableLength(List<Column> columns)
columns - A list of columns in a table definition
public static short countNonLongVariableLength(List<Column> 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||