|
|||||||||
| 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
| 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 |
FIXED_LEN_FLAG_MASK
mask for the fixed len bit |
static byte |
UNKNOWN_FLAG_MASK
mask for the unknown bit |
| Constructor Summary | |
|---|---|
Column()
|
|
Column(JetFormat format)
|
|
Column(Table table,
ByteBuffer buffer,
int offset)
Read a column definition in from a buffer |
|
| Method Summary | |
|---|---|
int |
compareTo(Column other)
|
static short |
countNonLongVariableLength(List<Column> columns)
|
static short |
countVariableLength(List<Column> columns)
|
static String |
decodeUncompressedText(byte[] textBytes,
JetFormat format)
|
static ByteBuffer |
encodeUncompressedText(CharSequence text,
JetFormat format)
|
int |
getColumnIndex()
|
short |
getColumnNumber()
|
int |
getFixedDataOffset()
|
JetFormat |
getFormat()
|
short |
getLength()
|
short |
getLengthInUnits()
|
String |
getName()
|
PageChannel |
getPageChannel()
|
byte |
getPrecision()
|
byte |
getScale()
|
int |
getSQLType()
|
Table |
getTable()
|
DataType |
getType()
|
int |
getVarLenTableIndex()
|
boolean |
isAutoNumber()
|
boolean |
isCompressedUnicode()
|
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 |
setFixedDataOffset(int newOffset)
|
void |
setLength(short length)
|
void |
setLengthInUnits(short unitLength)
|
void |
setName(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(Object obj)
Interpret a boolean value (null == false) |
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 byte FIXED_LEN_FLAG_MASK
public static final byte AUTO_NUMBER_FLAG_MASK
public static final byte UNKNOWN_FLAG_MASK
| Constructor Detail |
|---|
public Column()
public Column(JetFormat format)
public Column(Table table,
ByteBuffer buffer,
int offset)
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 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 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 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 void validate(JetFormat format)
IllegalArgumentException - if this column definition is invalid.
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,
JetFormat format)
textBytes - bytes of text to decodeformat - relevant db format
public static ByteBuffer encodeUncompressedText(CharSequence text,
JetFormat format)
text - Text to encodeformat - relevant db format
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)
public static boolean toBooleanValue(Object obj)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||