Java Doc for AbstractProcessor.java in  » Database-Client » iSQL-Viewer » org » isqlviewer » sql » processor » 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 » iSQL Viewer » org.isqlviewer.sql.processor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.isqlviewer.sql.processor.AbstractProcessor

All known Subclasses:   org.isqlviewer.sql.processor.SqlProcessor,
AbstractProcessor
abstract public class AbstractProcessor (Code)
TODO Add Scanner JavaDoc inforamation


author:
   Mark A. Kobold <mkobold at isqlviewer dot com>
version:
   1.0



Field Summary
protected  char[]buffer
     The current buffer of text being scanned.
protected  intend
     The end offset in the buffer.
protected  intstart
     The current offset within the buffer, at which to scan the next token.
protected  TokenTypestate
     The current scanner state, as a representative token type.
protected  TreeMap<String, TextSymbol>symbolTable
     The symbol table can be accessed by initSymbolTable or lookup, if they are overridden.

Constructor Summary
public  AbstractProcessor()
    

Method Summary
public  intchange(int firstIndex, int len, int newLen)
     Report the position of an edit, the length of the text being replaced, and the length of the replacement text, to prepare for rescanning.
public  intfind(int p)
     Find the index of the valid token starting before, but nearest to, text position p.
public  TokengetToken(int n)
     Find the n'th token, or null if it is not currently valid.
abstract protected  voidinitSymbolTable()
     Create the initial symbol table.
protected  TextSymbollookup(TokenType type, String name)
     Lookup a symbol in the symbol table.
public  intposition()
     Find out at what text position any remaining scanning work should start, or -1 if scanning is complete.
protected  TokenTyperead()
    

Read one token from the start of the current text buffer, given the start offset, end offset, and current scanner state.

public  intscan(char[] array, int offset, int length)
     Scan or rescan a given read-only segment of text.
public  intsize()
     Find the number of available valid tokens, not counting tokens in or after any area yet to be rescanned.

Field Detail
buffer
protected char[] buffer(Code)
The current buffer of text being scanned.



end
protected int end(Code)
The end offset in the buffer.



start
protected int start(Code)
The current offset within the buffer, at which to scan the next token.



state
protected TokenType state(Code)
The current scanner state, as a representative token type.



symbolTable
protected TreeMap<String, TextSymbol> symbolTable(Code)
The symbol table can be accessed by initSymbolTable or lookup, if they are overridden. Symbols are inserted with symbolTable.put(sym,sym) and extracted with symbolTable.get(sym).




Constructor Detail
AbstractProcessor
public AbstractProcessor()(Code)




Method Detail
change
public int change(int firstIndex, int len, int newLen)(Code)
Report the position of an edit, the length of the text being replaced, and the length of the replacement text, to prepare for rescanning. The call returns the index of the token at which rescanning will start.



find
public int find(int p)(Code)
Find the index of the valid token starting before, but nearest to, text position p. This uses an O(log(n)) binary chop search.



getToken
public Token getToken(int n)(Code)
Find the n'th token, or null if it is not currently valid.



initSymbolTable
abstract protected void initSymbolTable()(Code)
Create the initial symbol table. This can be overridden to enter keywords, for example. The default implementation does nothing.



lookup
protected TextSymbol lookup(TokenType type, String name)(Code)
Lookup a symbol in the symbol table. This can be overridden to implement keyword detection, for example. The default implementation just uses the table to ensure that there is only one shared occurrence of each symbol.



position
public int position()(Code)
Find out at what text position any remaining scanning work should start, or -1 if scanning is complete.



read
protected TokenType read()(Code)

Read one token from the start of the current text buffer, given the start offset, end offset, and current scanner state. The method moves the start offset past the token, updates the scanner state, and returns the type of the token just scanned.

The scanner state is a representative token type. It is either the state left after the last call to read, or the type of the old token at the same position if rescanning, or WHITESPACE if at the start of a document. The method succeeds in all cases, returning whitespace or comment or error tokens where necessary. Each line of a multi-line comment is treated as a separate token, to improve incremental rescanning. If the buffer does not extend to the end of the document, the last token returned for the buffer may be incomplete and the caller must rescan it. The read method can be overridden to implement different languages. The default version splits plain text into words, numbers and punctuation.




scan
public int scan(char[] array, int offset, int length)(Code)
Scan or rescan a given read-only segment of text. The segment is assumed to represent a portion of the document starting at position(). Return the number of tokens successfully scanned, excluding any partial token at the end of the text segment but not at the end of the document. If the result is 0, the call should be retried with a longer segment.



size
public int size()(Code)
Find the number of available valid tokens, not counting tokens in or after any area yet to be rescanned.



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.