Java Doc for TokenMarker.java in  » Report » iReport-2.0.5 » org » syntax » jedit » tokenmarker » 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 » Report » iReport 2.0.5 » org.syntax.jedit.tokenmarker 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.syntax.jedit.tokenmarker.TokenMarker

All known Subclasses:   org.syntax.jedit.tokenmarker.MakefileTokenMarker,  org.syntax.jedit.tokenmarker.ShellScriptTokenMarker,  org.syntax.jedit.tokenmarker.TeXTokenMarker,  org.syntax.jedit.tokenmarker.PerlTokenMarker,  org.syntax.jedit.tokenmarker.HTMLTokenMarker,  org.syntax.jedit.tokenmarker.CTokenMarker,  org.syntax.jedit.tokenmarker.SQLTokenMarker,  org.syntax.jedit.tokenmarker.EiffelTokenMarker,  it.businesslogic.ireport.gui.syntax.JRTokenMarker,  org.syntax.jedit.tokenmarker.PythonTokenMarker,  org.syntax.jedit.tokenmarker.BatchFileTokenMarker,  org.syntax.jedit.tokenmarker.PropsTokenMarker,  org.syntax.jedit.tokenmarker.PatchTokenMarker,  org.syntax.jedit.tokenmarker.PHPTokenMarker,
TokenMarker
abstract public class TokenMarker (Code)
A token marker that splits lines of text into tokens. Each token carries a length field and an indentification tag that can be mapped to a color for painting that token.

For performance reasons, the linked list of tokens is reused after each line is tokenized. Therefore, the return value of markTokens should only be used for immediate painting. Notably, it cannot be cached.
author:
   Slava Pestov
version:
   $Id: TokenMarker.java 1167 2008-01-15 18:49:05Z gtoffoli $
version:
   $Id: TokenMarker.java 1167 2008-01-15 18:49:05Z gtoffoli $
See Also:   org.syntax.jedit.Token


Inner Class :public class LineInfo

Field Summary
protected  TokenfirstToken
     The first token in the list.
protected  KeywordLookupIFkeywordLookup
    
protected  intlastLine
     The last tokenized line.
protected  TokenlastToken
     The last token in the list.
protected  intlength
     The number of lines in the model being tokenized.
protected  LineInfo[]lineInfo
     An array for storing information about lines.
protected  booleannextLineRequested
     True if the next line should be painted.

Constructor Summary
protected  TokenMarker()
     Creates a new TokenMarker.

Method Summary
protected  voidaddToken(int length, byte id)
     Adds a token to the token list.
public  voiddeleteLines(int index, int lines)
     Informs the token marker that line have been deleted from the document.
protected  voidensureCapacity(int index)
     Ensures that the lineInfo array can contain the specified index.
public  intgetLineCount()
     Returns the number of lines in this token marker.
public  voidinsertLines(int index, int lines)
     Informs the token marker that lines have been inserted into the document.
public  booleanisNextLineRequested()
     Returns true if the next line should be repainted.
public  TokenmarkTokens(Segment line, int lineIndex)
     A wrapper for the lower-level markTokensImpl method that is called to split a line up into tokens.
abstract protected  bytemarkTokensImpl(byte token, Segment line, int lineIndex)
     An abstract method that splits a line up into tokens.
public  voidsetKeywordLookup(KeywordLookupIF keywordLookup)
     Add your own keywords.
public  booleansupportsMultilineTokens()
     Returns if the token marker supports tokens that span multiple lines.

Field Detail
firstToken
protected Token firstToken(Code)
The first token in the list. This should be used as the return value from markTokens().



keywordLookup
protected KeywordLookupIF keywordLookup(Code)



lastLine
protected int lastLine(Code)
The last tokenized line.



lastToken
protected Token lastToken(Code)
The last token in the list. New tokens are added here. This should be set to null before a new line is to be tokenized.



length
protected int length(Code)
The number of lines in the model being tokenized. This can be less than the length of the lineInfo array.



lineInfo
protected LineInfo[] lineInfo(Code)
An array for storing information about lines. It is enlarged and shrunk automatically by the insertLines() and deleteLines() methods.



nextLineRequested
protected boolean nextLineRequested(Code)
True if the next line should be painted.




Constructor Detail
TokenMarker
protected TokenMarker()(Code)
Creates a new TokenMarker. This DOES NOT create a lineInfo array; an initial call to insertLines() does that.




Method Detail
addToken
protected void addToken(int length, byte id)(Code)
Adds a token to the token list.
Parameters:
  length - The length of the token
Parameters:
  id - The id of the token



deleteLines
public void deleteLines(int index, int lines)(Code)
Informs the token marker that line have been deleted from the document. This removes the lines in question from the lineInfo array.
Parameters:
  index - The first line number
Parameters:
  lines - The number of lines



ensureCapacity
protected void ensureCapacity(int index)(Code)
Ensures that the lineInfo array can contain the specified index. This enlarges it if necessary. No action is taken if the array is large enough already.

It should be unnecessary to call this under normal circumstances; insertLine() should take care of enlarging the line info array automatically.
Parameters:
  index - The array index




getLineCount
public int getLineCount()(Code)
Returns the number of lines in this token marker.



insertLines
public void insertLines(int index, int lines)(Code)
Informs the token marker that lines have been inserted into the document. This inserts a gap in the lineInfo array.
Parameters:
  index - The first line number
Parameters:
  lines - The number of lines



isNextLineRequested
public boolean isNextLineRequested()(Code)
Returns true if the next line should be repainted. This will return true after a line has been tokenized that starts a multiline token that continues onto the next line.



markTokens
public Token markTokens(Segment line, int lineIndex)(Code)
A wrapper for the lower-level markTokensImpl method that is called to split a line up into tokens.
Parameters:
  line - The line
Parameters:
  lineIndex - The line number



markTokensImpl
abstract protected byte markTokensImpl(byte token, Segment line, int lineIndex)(Code)
An abstract method that splits a line up into tokens. It should parse the line, and call addToken() to add syntax tokens to the token list. Then, it should return the initial token type for the next line.

For example if the current line contains the start of a multiline comment that doesn't end on that line, this method should return the comment token type so that it continues on the next line.
Parameters:
  token - The initial token type for this line
Parameters:
  line - The line to be tokenized
Parameters:
  lineIndex - The index of the line in the document,starting at 0 The initial token type for the next line




setKeywordLookup
public void setKeywordLookup(KeywordLookupIF keywordLookup)(Code)
Add your own keywords.



supportsMultilineTokens
public boolean supportsMultilineTokens()(Code)
Returns if the token marker supports tokens that span multiple lines. If this is true, the object using this token marker is required to pass all lines in the document to the markTokens() method (in turn).

The default implementation returns true; it should be overridden to return false on simpler token markers for increased speed.




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.