Java Doc for Table.java in  » Database-Client » Jackcess » com » healthmarketscience » jackcess » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » Jackcess » com.healthmarketscience.jackcess 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.healthmarketscience.jackcess.Table

Table
public class Table implements Iterable<Map<String, Object>>(Code)
A single database table

Is not thread-safe.
author:
   Tim McCune


Inner Class :final public class RowState

Field Summary
final public static  byteTYPE_SYSTEM
    
final public static  byteTYPE_USER
    

Constructor Summary
 Table(boolean testing, List<Column> columns)
    
protected  Table(Database database, ByteBuffer tableBuffer, int pageNumber, String name)
    

Method Summary
public static  intaddDataPageRow(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  voidaddRow(Object... row)
    
public  voidaddRows(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  shortcleanRowStart(short rowStart)
    
public static  intcountAutoNumberColumns(Collection<Column> columns)
    
 ByteBuffercreateRow(Object[] rowArray, int maxRowSize, ByteBuffer buffer)
    
public  RowStatecreateRowState()
    
public  voiddeleteCurrentRow()
     Delete the current row (retrieved by a call to Table.getNextRow() ).
public  voiddeleteRow(RowState rowState, RowId rowId)
     Delete the row on which the given rowState is currently positioned.
public  Stringdisplay()
    
public  Stringdisplay(long limit)
    
public static  shortfindRowEnd(ByteBuffer buffer, int rowNum, JetFormat format)
    
public static  shortfindRowStart(ByteBuffer buffer, int rowNum, JetFormat format)
    
public  ColumngetColumn(String name)
    
public  intgetColumnCount()
    
public  List<Column>getColumns()
    
public  DatabasegetDatabase()
    
public  JetFormatgetFormat()
    
public  IndexgetIndex(String name)
    
 intgetIndexSlotCount()
    
public  List<Index>getIndexes()
    
 intgetLastAutoNumber()
    
public  intgetMaxColumnCount()
    
public  StringgetName()
    
public  Map<String, Object>getNextRow()
    
public  Map<String, Object>getNextRow(Collection<String> columnNames)
    
protected  UsageMap.PageCursorgetOwnedPagesCursor()
    
public  PageChannelgetPageChannel()
    
public  Map<String, Object>getRow(RowState rowState, RowId rowId, Collection<String> columnNames)
     Reads some columns from the given row.
public  intgetRowCount()
    
public static  intgetRowEndOffset(int rowNum, JetFormat format)
    
public static  intgetRowSpaceUsage(int rowSize, JetFormat format)
    
public static  intgetRowStartOffset(int rowNum, JetFormat format)
    
public  ObjectgetRowValue(RowState rowState, RowId rowId, Column column)
     Reads a single column from the given row.
protected  intgetTableDefPageNumber()
    
public static  booleanisDeletedRow(short rowStart)
    
public static  booleanisOverflowRow(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  ByteBufferpositionAtRowData(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  ByteBufferpositionAtRowHeader(RowState rowState, RowId rowId)
     Sets a new buffer to the correct row header page using the given rowState according to the given rowId.
public  voidreset()
    
public  StringtoString()
    
public static  intwriteTableDefinition(List<Column> columns, PageChannel pageChannel, JetFormat format)
     Writes a new table defined by the given columns to the database.

Field Detail
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




Constructor Detail
Table
Table(boolean testing, List<Column> columns) throws IOException(Code)
Only used by unit tests



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




Method Detail
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



asRow
public Object[] asRow(Map<String, Object> rowMap)(Code)
Converts a map of columnName -> columnValue to an array of row values appropriate for a call to Table.addRow(Object) .



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)



deleteCurrentRow
public void deleteCurrentRow() throws IOException(Code)
Delete the current row (retrieved by a call to Table.getNextRow() ).



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)



getColumn
public Column getColumn(String name)(Code)
the column with the given name



getColumnCount
public int getColumnCount()(Code)



getColumns
public List<Column> getColumns()(Code)
All of the columns in this table (unmodifiable List)



getDatabase
public Database getDatabase()(Code)



getFormat
public JetFormat getFormat()(Code)



getIndex
public Index getIndex(String name)(Code)
the index with the given name



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)



getName
public String getName()(Code)
The name of the table



getNextRow
public Map<String, Object> getNextRow() throws IOException(Code)
The next row in this table (Column name -> Column value)



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)



getOwnedPagesCursor
protected UsageMap.PageCursor getOwnedPagesCursor()(Code)



getPageChannel
public PageChannel getPageChannel()(Code)



getRow
public Map<String, Object> getRow(RowState rowState, RowId rowId, Collection<String> columnNames) throws IOException(Code)
Reads some columns from the given row.
Parameters:
  columnNames - Only column names in this collection will be returned



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)



getRowValue
public Object getRowValue(RowState rowState, RowId rowId, Column column) throws IOException(Code)
Reads a single column from the given row.



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



toString
public String toString()(Code)



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.