| java.lang.Object com.healthmarketscience.jackcess.Table
Inner Class :final public class RowState | |
Method Summary | |
public static int | addDataPageRow(ByteBuffer dataPage, int rowSize, JetFormat format) Updates free space and row info for a new row of the given size in the
given data page. | public void | addRow(Object... row) | public void | addRows(List<? extends Object[]> rows) Add multiple rows to this table, only writing to disk after all
rows have been written, and every time a data page is filled. | public Object[] | asRow(Map<String, Object> rowMap) Converts a map of columnName -> columnValue to an array of row values
appropriate for a call to
Table.addRow(Object) . | public static short | cleanRowStart(short rowStart) | public static int | countAutoNumberColumns(Collection<Column> columns) | ByteBuffer | createRow(Object[] rowArray, int maxRowSize, ByteBuffer buffer) | public RowState | createRowState() | public void | deleteCurrentRow() Delete the current row (retrieved by a call to
Table.getNextRow() ). | public void | deleteRow(RowState rowState, RowId rowId) Delete the row on which the given rowState is currently positioned. | public String | display() | public String | display(long limit) | public static short | findRowEnd(ByteBuffer buffer, int rowNum, JetFormat format) | public static short | findRowStart(ByteBuffer buffer, int rowNum, JetFormat format) | public Column | getColumn(String name) | public int | getColumnCount() | public List<Column> | getColumns() | public Database | getDatabase() | public JetFormat | getFormat() | public Index | getIndex(String name) | int | getIndexSlotCount() | public List<Index> | getIndexes() | int | getLastAutoNumber() | public int | getMaxColumnCount() | public String | getName() | public Map<String, Object> | getNextRow() | public Map<String, Object> | getNextRow(Collection<String> columnNames) | protected UsageMap.PageCursor | getOwnedPagesCursor() | public PageChannel | getPageChannel() | public Map<String, Object> | getRow(RowState rowState, RowId rowId, Collection<String> columnNames) Reads some columns from the given row. | public int | getRowCount() | public static int | getRowEndOffset(int rowNum, JetFormat format) | public static int | getRowSpaceUsage(int rowSize, JetFormat format) | public static int | getRowStartOffset(int rowNum, JetFormat format) | public Object | getRowValue(RowState rowState, RowId rowId, Column column) Reads a single column from the given row. | protected int | getTableDefPageNumber() | public static boolean | isDeletedRow(short rowStart) | public static boolean | isOverflowRow(short rowStart) | public Iterator<Map<String, Object>> | iterator() Calls reset on this table and returns an unmodifiable
Iterator which will iterate through all the rows of this table. | public Iterator<Map<String, Object>> | iterator(Collection<String> columnNames) Calls reset on this table and returns an unmodifiable
Iterator which will iterate through all the rows of this table, returning
only the given columns. | public static ByteBuffer | positionAtRowData(RowState rowState, RowId rowId) Sets the position and limit in a new buffer using the given rowState
according to the given row number and row end, following overflow row
pointers as necessary. | public static ByteBuffer | positionAtRowHeader(RowState rowState, RowId rowId) Sets a new buffer to the correct row header page using the given rowState
according to the given rowId. | public void | reset() | public String | toString() | public static int | writeTableDefinition(List<Column> columns, PageChannel pageChannel, JetFormat format) Writes a new table defined by the given columns to the database. |
TYPE_SYSTEM | final public static byte TYPE_SYSTEM(Code) | | Table type code for system tables
|
TYPE_USER | final public static byte TYPE_USER(Code) | | Table type code for user tables
|
Table | protected Table(Database database, ByteBuffer tableBuffer, int pageNumber, String name) throws IOException(Code) | | Parameters: database - database which owns this table Parameters: tableBuffer - Buffer to read the table with Parameters: pageNumber - Page number of the table definition Parameters: name - Table name |
addDataPageRow | public static int addDataPageRow(ByteBuffer dataPage, int rowSize, JetFormat format)(Code) | | Updates free space and row info for a new row of the given size in the
given data page. Positions the page for writing the row data.
the row number of the new row |
addRow | public void addRow(Object... row) throws IOException(Code) | | Add a single row to this table and write it to disk
|
addRows | public void addRows(List<? extends Object[]> rows) throws IOException(Code) | | Add multiple rows to this table, only writing to disk after all
rows have been written, and every time a data page is filled. This
is much more efficient than calling addRow multiple times.
Parameters: rows - List of Object[] row values |
cleanRowStart | public static short cleanRowStart(short rowStart)(Code) | | |
countAutoNumberColumns | public static int countAutoNumberColumns(Collection<Column> columns)(Code) | | the number of "AutoNumber" columns in the given collection ofcolumns. |
createRow | ByteBuffer createRow(Object[] rowArray, int maxRowSize, ByteBuffer buffer) throws IOException(Code) | | Serialize a row of Objects into a byte buffer
|
createRowState | public RowState createRowState()(Code) | | |
deleteRow | public void deleteRow(RowState rowState, RowId rowId) throws IOException(Code) | | Delete the row on which the given rowState is currently positioned.
|
display | public String display() throws IOException(Code) | | A simple String representation of the entire table in tab-delimited format |
display | public String display(long limit) throws IOException(Code) | | Parameters: limit - Maximum number of rows to display A simple String representation of the entire table in tab-delimited format |
findRowEnd | public static short findRowEnd(ByteBuffer buffer, int rowNum, JetFormat format)(Code) | | |
findRowStart | public static short findRowStart(ByteBuffer buffer, int rowNum, JetFormat format)(Code) | | |
getColumnCount | public int getColumnCount()(Code) | | |
getColumns | public List<Column> getColumns()(Code) | | All of the columns in this table (unmodifiable List) |
getIndexSlotCount | int getIndexSlotCount()(Code) | | Only called by unit tests
|
getIndexes | public List<Index> getIndexes()(Code) | | All of the Indexes on this table (unmodifiable List) |
getLastAutoNumber | int getLastAutoNumber()(Code) | | |
getMaxColumnCount | public int getMaxColumnCount()(Code) | | |
getNextRow | public Map<String, Object> getNextRow(Collection<String> columnNames) throws IOException(Code) | | Parameters: columnNames - Only column names in this collection will be returned The next row in this table (Column name -> Column value) |
getRowCount | public int getRowCount()(Code) | | |
getRowEndOffset | public static int getRowEndOffset(int rowNum, JetFormat format)(Code) | | |
getRowSpaceUsage | public static int getRowSpaceUsage(int rowSize, JetFormat format)(Code) | | |
getRowStartOffset | public static int getRowStartOffset(int rowNum, JetFormat format)(Code) | | |
getTableDefPageNumber | protected int getTableDefPageNumber()(Code) | | |
isDeletedRow | public static boolean isDeletedRow(short rowStart)(Code) | | |
isOverflowRow | public static boolean isOverflowRow(short rowStart)(Code) | | |
iterator | public Iterator<Map<String, Object>> iterator()(Code) | | Calls reset on this table and returns an unmodifiable
Iterator which will iterate through all the rows of this table. Use of
the Iterator follows the same restrictions as a call to
getNextRow .
throws: IllegalStateException - if an IOException is thrown by one of theoperations, the actual exception will be contained within |
iterator | public Iterator<Map<String, Object>> iterator(Collection<String> columnNames)(Code) | | Calls reset on this table and returns an unmodifiable
Iterator which will iterate through all the rows of this table, returning
only the given columns. Use of the Iterator follows the same
restrictions as a call to getNextRow .
throws: IllegalStateException - if an IOException is thrown by one of theoperations, the actual exception will be contained within |
positionAtRowData | public static ByteBuffer positionAtRowData(RowState rowState, RowId rowId) throws IOException(Code) | | Sets the position and limit in a new buffer using the given rowState
according to the given row number and row end, following overflow row
pointers as necessary.
a ByteBuffer narrowed to the actual row data, or null if row wasinvalid or deleted |
positionAtRowHeader | public static ByteBuffer positionAtRowHeader(RowState rowState, RowId rowId) throws IOException(Code) | | Sets a new buffer to the correct row header page using the given rowState
according to the given rowId. Deleted state is
determined, but overflow row pointers are not followed.
a ByteBuffer of the relevant page, or null if row was invalid |
reset | public void reset()(Code) | | After calling this method, getNextRow will return the first row in the
table
|
writeTableDefinition | public static int writeTableDefinition(List<Column> columns, PageChannel pageChannel, JetFormat format) throws IOException(Code) | | Writes a new table defined by the given columns to the database.
the first page of the new table's definition |
|
|