|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
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. |
Field Summary | |
---|---|
static java.lang.Object |
AUTO_NUMBER
Meaningless placeholder object for inserting values in an autonumber column. it is not required that this value be used (any passed in value is ignored), but using this placeholder may make code more obvious. |
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 java.lang.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 |
Constructor Summary | |
---|---|
Column()
|
|
Column(JetFormat format)
|
|
Column(Table table,
java.nio.ByteBuffer buffer,
int offset)
Read a column definition in from a buffer |
Method Summary | |
---|---|
int |
compareTo(Column other)
|
static short |
countNonLongVariableLength(java.util.List<Column> columns)
|
static short |
countVariableLength(java.util.List<Column> columns)
|
static java.lang.String |
decodeUncompressedText(byte[] textBytes,
java.nio.charset.Charset charset)
|
static java.nio.ByteBuffer |
encodeUncompressedText(java.lang.CharSequence text,
java.nio.charset.Charset charset)
|
Column.AutoNumberGenerator |
getAutoNumberGenerator()
Returns the AutoNumberGenerator for this column if this is an autonumber column, null
otherwise. |
int |
getColumnIndex()
|
short |
getColumnNumber()
|
int |
getFixedDataOffset()
|
JetFormat |
getFormat()
|
short |
getLength()
|
short |
getLengthInUnits()
|
java.lang.String |
getName()
|
PageChannel |
getPageChannel()
|
byte |
getPrecision()
|
byte |
getScale()
|
int |
getSQLType()
|
Table |
getTable()
|
DataType |
getType()
|
int |
getVarLenTableIndex()
|
boolean |
isAutoNumber()
|
boolean |
isCompressedUnicode()
|
boolean |
isVariableLength()
|
java.lang.Object |
read(byte[] data)
Deserialize a raw byte value for this column into an Object |
java.lang.Object |
read(byte[] data,
java.nio.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 |
setLength(short length)
|
void |
setLengthInUnits(short unitLength)
|
void |
setName(java.lang.String name)
|
void |
setPrecision(byte newPrecision)
|
void |
setScale(byte newScale)
|
void |
setSQLType(int type)
|
void |
setSQLType(int type,
int lengthInUnits)
|
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)
|
static boolean |
toBooleanValue(java.lang.Object obj)
Interpret a boolean value (null == false) |
static byte[] |
toByteArray(java.lang.Object value)
|
static java.lang.CharSequence |
toCharSequence(java.lang.Object value)
|
java.lang.String |
toString()
|
void |
validate(JetFormat format)
Checks that this column definition is valid. |
java.nio.ByteBuffer |
write(java.lang.Object obj,
int remainingRowLength)
Serialize an Object into a raw byte value for this column in little endian order |
java.nio.ByteBuffer |
write(java.lang.Object obj,
int remainingRowLength,
java.nio.ByteOrder order)
Serialize an Object into a raw byte value for this column |
java.nio.ByteBuffer |
writeFixedLengthField(java.lang.Object obj,
java.nio.ByteOrder order)
Serialize an Object into a raw byte value for this column |
java.nio.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 java.lang.Object AUTO_NUMBER
public static final java.lang.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 UNKNOWN_FLAG_MASK
Constructor Detail |
---|
public Column()
public Column(JetFormat format)
public Column(Table table, java.nio.ByteBuffer buffer, int offset) throws java.io.IOException
table
- owning tablebuffer
- Buffer containing column definitionoffset
- Offset in the buffer at which the column definition starts
java.io.IOException
Method Detail |
---|
public Table getTable()
public JetFormat getFormat()
public PageChannel getPageChannel()
public java.lang.String getName()
public void setName(java.lang.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 void setType(DataType type)
public DataType getType()
public int getSQLType() throws java.sql.SQLException
java.sql.SQLException
public void setSQLType(int type) throws java.sql.SQLException
java.sql.SQLException
public void setSQLType(int type, int lengthInUnits) throws java.sql.SQLException
java.sql.SQLException
public boolean isCompressedUnicode()
public void setCompressedUnicode(boolean newCompessedUnicode)
public byte getPrecision()
public void setPrecision(byte newPrecision)
public byte getScale()
public void setScale(byte newScale)
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 Column.AutoNumberGenerator getAutoNumberGenerator()
null
otherwise.
public void validate(JetFormat format)
java.lang.IllegalArgumentException
- if this column definition is invalid.public java.lang.Object read(byte[] data) throws java.io.IOException
data
- The raw byte value
java.io.IOException
public java.lang.Object read(byte[] data, java.nio.ByteOrder order) throws java.io.IOException
data
- The raw byte valueorder
- Byte order in which the raw value is stored
java.io.IOException
public java.nio.ByteBuffer writeLongValue(byte[] value, int remainingRowLength) throws java.io.IOException
value
- Value of the LVAL column
java.io.IOException
public java.nio.ByteBuffer write(java.lang.Object obj, int remainingRowLength) throws java.io.IOException
obj
- Object to serialize
java.io.IOException
public java.nio.ByteBuffer write(java.lang.Object obj, int remainingRowLength, java.nio.ByteOrder order) throws java.io.IOException
obj
- Object to serializeorder
- Order in which to serialize
java.io.IOException
public java.nio.ByteBuffer writeFixedLengthField(java.lang.Object obj, java.nio.ByteOrder order) throws java.io.IOException
obj
- Object to serializeorder
- Order in which to serialize
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String decodeUncompressedText(byte[] textBytes, java.nio.charset.Charset charset)
textBytes
- bytes of text to decodecharset
- relevant charset
public static java.nio.ByteBuffer encodeUncompressedText(java.lang.CharSequence text, java.nio.charset.Charset charset)
text
- Text to encodedb
- relevant db
public int compareTo(Column other)
compareTo
in interface java.lang.Comparable<Column>
public static short countVariableLength(java.util.List<Column> columns)
columns
- A list of columns in a table definition
public static short countNonLongVariableLength(java.util.List<Column> columns)
columns
- A list of columns in a table definition
public static java.lang.CharSequence toCharSequence(java.lang.Object value) throws java.io.IOException
java.io.IOException
public static byte[] toByteArray(java.lang.Object value) throws java.io.IOException
java.io.IOException
public static boolean toBooleanValue(java.lang.Object obj)
|
Elexis API documentationVersion 2.1.6 as of December 11 2011 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |