Java Doc for TextCache.java in  » Database-DBMS » hsql » org » hsqldb » persist » 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 DBMS » hsql » org.hsqldb.persist 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.persist.DataFileCache
      org.hsqldb.persist.TextCache

TextCache
public class TextCache extends DataFileCache (Code)
Acts as a buffer manager for a single TEXT table with respect its Row data.

Handles read/write operations on the table's text format data file using a compatible pair of org.hsqldb.rowio input/output class instances.
author:
   sqlbob@users (RMP)
version:
   1.8.0
since:
   1.7.0



Field Summary
final static  charBACKSLASH_CHAR
    
final static  charCR_CHAR
    
final static  charDOUBLE_QUOTE_CHAR
    
final static  charLF_CHAR
    
final public static  StringNL
    
public  Stringfs
    
protected  Stringheader
    
public  booleanignoreFirst
    
public  booleanisAllQuoted
    
public  booleanisQuoted
    
public  Stringlvs
    
public  StringstringEncoding
    
protected  Tabletable
    
public  Stringvs
    

Constructor Summary
 TextCache(Table table, String name)
    

Method Summary
public synchronized  voidadd(CachedObject object)
    
public  voidclose(boolean write)
     Writes newly created rows to disk.
 intfindNextUsedLinePos(int pos)
     Searches from file pointer, pos, and finds the beginning of the first line that contains any non-space character.
public synchronized  CachedObjectget(int i, PersistentStore store, boolean keep)
    
public  StringgetHeader()
    
public  intgetLineNumber()
    
protected  voidinitBuffers()
    
protected  voidinitParams(Database database, String baseFileName)
    
public  voidopen(boolean readonly)
     Opens a data source file.
 voidpurge()
     Closes the source file and deletes it if it is not read-only.
public  intreadHeaderLine()
    
protected synchronized  RowInputInterfacereadObject(int pos)
    
public synchronized  voidremove(int pos, PersistentStore store)
    
public synchronized  voidremovePersistence(int pos, PersistentStore store)
    
 voidreopen()
    
public synchronized  voidsaveRow(CachedObject row)
     In case the row has been moved to the uncommittedCache, removes it.
protected synchronized  voidsaveRows(CachedObject[] rows, int offset, int count)
     This is called internally when old rows need to be removed from the cache.
protected  voidsetFileModified()
    
public  voidsetHeader(String header)
    

Field Detail
BACKSLASH_CHAR
final static char BACKSLASH_CHAR(Code)



CR_CHAR
final static char CR_CHAR(Code)



DOUBLE_QUOTE_CHAR
final static char DOUBLE_QUOTE_CHAR(Code)



LF_CHAR
final static char LF_CHAR(Code)



NL
final public static String NL(Code)



fs
public String fs(Code)



header
protected String header(Code)



ignoreFirst
public boolean ignoreFirst(Code)



isAllQuoted
public boolean isAllQuoted(Code)



isQuoted
public boolean isQuoted(Code)



lvs
public String lvs(Code)



stringEncoding
public String stringEncoding(Code)



table
protected Table table(Code)



vs
public String vs(Code)




Constructor Detail
TextCache
TextCache(Table table, String name) throws HsqlException(Code)
The source string for a cached table is evaluated and the parameters are used to open the source file.

Settings are used in this order: (1) settings specified in the source string for the table (2) global database settings in .properties file (3) program defaults fredt - this used to write rows as soon as they are inserted but now this is subject to session autoCommit / or commit storeOnInsert = true;





Method Detail
add
public synchronized void add(CachedObject object) throws IOException(Code)



close
public void close(boolean write) throws HsqlException(Code)
Writes newly created rows to disk. In the current implentation, such rows have already been saved, so this method just removes a source file that has no rows.



findNextUsedLinePos
int findNextUsedLinePos(int pos) throws IOException(Code)
Searches from file pointer, pos, and finds the beginning of the first line that contains any non-space character. Increments the row counter when a blank line is skipped. If none found return -1



get
public synchronized CachedObject get(int i, PersistentStore store, boolean keep) throws HsqlException(Code)



getHeader
public String getHeader()(Code)



getLineNumber
public int getLineNumber()(Code)



initBuffers
protected void initBuffers()(Code)



initParams
protected void initParams(Database database, String baseFileName) throws HsqlException(Code)



open
public void open(boolean readonly) throws HsqlException(Code)
Opens a data source file.



purge
void purge() throws HsqlException(Code)
Closes the source file and deletes it if it is not read-only.



readHeaderLine
public int readHeaderLine() throws HsqlException(Code)



readObject
protected synchronized RowInputInterface readObject(int pos) throws IOException(Code)



remove
public synchronized void remove(int pos, PersistentStore store) throws IOException(Code)



removePersistence
public synchronized void removePersistence(int pos, PersistentStore store) throws IOException(Code)



reopen
void reopen() throws HsqlException(Code)



saveRow
public synchronized void saveRow(CachedObject row) throws IOException(Code)
In case the row has been moved to the uncommittedCache, removes it. Then saves the row as normal.



saveRows
protected synchronized void saveRows(CachedObject[] rows, int offset, int count) throws IOException(Code)
This is called internally when old rows need to be removed from the cache. Text table rows that have not been saved are those that have not been committed yet. So we don't save them but add them to the uncommitted cache until such time that they are committed or rolled back- fredt



setFileModified
protected void setFileModified() throws IOException(Code)



setHeader
public void setHeader(String header) throws HsqlException(Code)



Fields inherited from org.hsqldb.persist.DataFileCache
final static int FLAGS_POS(Code)(Java Doc)
final public static int FLAG_ISSAVED(Code)(Java Doc)
final public static int FLAG_ROWINFO(Code)(Java Doc)
final static int INITIAL_FREE_POS(Code)(Java Doc)
final static int LONG_EMPTY_INDEX_POS(Code)(Java Doc)
final static int LONG_EMPTY_SIZE(Code)(Java Doc)
final static int LONG_FREE_POS_POS(Code)(Java Doc)
protected String backupFileName(Code)(Java Doc)
protected Cache cache(Code)(Java Doc)
protected int cacheFileScale(Code)(Java Doc)
protected boolean cacheReadonly(Code)(Java Doc)
protected int cachedRowPadding(Code)(Java Doc)
protected Storage dataFile(Code)(Java Doc)
protected Database database(Code)(Java Doc)
protected FileAccess fa(Code)(Java Doc)
protected long fileFreePosition(Code)(Java Doc)
protected boolean fileModified(Code)(Java Doc)
protected String fileName(Code)(Java Doc)
DataFileBlockManager freeBlocks(Code)(Java Doc)
protected boolean hasRowInfo(Code)(Java Doc)
protected long maxCacheBytes(Code)(Java Doc)
protected int maxCacheSize(Code)(Java Doc)
public long maxDataFileSize(Code)(Java Doc)
protected int maxFreeBlocks(Code)(Java Doc)
protected RowInputInterface rowIn(Code)(Java Doc)
protected RowOutputInterface rowOut(Code)(Java Doc)
protected boolean storeOnInsert(Code)(Java Doc)

Methods inherited from org.hsqldb.persist.DataFileCache
public synchronized void add(CachedObject object) throws IOException(Code)(Java Doc)
void backupFile() throws IOException(Code)(Java Doc)
public long bytesCapacity()(Code)(Java Doc)
public int capacity()(Code)(Java Doc)
public void close(boolean write) throws HsqlException(Code)(Java Doc)
public void defrag() throws HsqlException(Code)(Java Doc)
void deleteBackup()(Code)(Java Doc)
void deleteFile(boolean wasNio)(Code)(Java Doc)
static void deleteOrResetFreePos(Database database, String filename)(Code)(Java Doc)
public synchronized CachedObject get(int i, PersistentStore store, boolean keep) throws HsqlException(Code)(Java Doc)
public int getCachedObjectCount()(Code)(Java Doc)
public long getFileFreePos()(Code)(Java Doc)
public String getFileName()(Code)(Java Doc)
public int getFreeBlockCount()(Code)(Java Doc)
synchronized RowInputInterface getRaw(int i) throws IOException(Code)(Java Doc)
public synchronized int getStorageSize(int i) throws IOException(Code)(Java Doc)
public long getTotalCachedBlockSize()(Code)(Java Doc)
public int getTotalFreeBlockSize()(Code)(Java Doc)
public boolean hasRowInfo()(Code)(Java Doc)
protected void initBuffers()(Code)(Java Doc)
protected void initParams(Database database, String baseFileName) throws HsqlException(Code)(Java Doc)
public boolean isFileModified()(Code)(Java Doc)
public void open(boolean readonly) throws HsqlException(Code)(Java Doc)
protected synchronized RowInputInterface readObject(int pos) throws IOException(Code)(Java Doc)
protected synchronized int readSize(int pos) throws IOException(Code)(Java Doc)
public synchronized CachedObject release(int i)(Code)(Java Doc)
public synchronized void remove(int i, PersistentStore store) throws IOException(Code)(Java Doc)
public synchronized void removePersistence(int i, PersistentStore store) throws IOException(Code)(Java Doc)
void renameBackupFile()(Code)(Java Doc)
void renameDataFile()(Code)(Java Doc)
public synchronized void restore(CachedObject object) throws IOException(Code)(Java Doc)
public synchronized void saveRow(CachedObject row) throws IOException(Code)(Java Doc)
protected synchronized void saveRows(CachedObject[] rows, int offset, int count) throws IOException(Code)(Java Doc)
protected synchronized void setFileModified() throws IOException(Code)(Java Doc)

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.