Java Doc for Analyzer.java in  » IDE-Netbeans » editor » org » netbeans » editor » 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 » IDE Netbeans » editor » org.netbeans.editor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.editor.Analyzer

Analyzer
public class Analyzer (Code)
Various text analyzes over the document
author:
   Miloslav Metelka
version:
   1.00


Field Summary
final public static  char[]EMPTY_CHAR_ARRAY
    


Method Summary
public static  booleanblocksHit(int[] blocks, int startPos, int endPos)
    
public static  intblocksIndex(int[] blocks, int startPos, int endPos)
    
public static  char[]concat(char[] chars1, char[] chars2)
    
public static  intconvertLFToLS(char[] src, int len, char[] tgt, String lsType)
     Convert text with LF line separators to text that uses line separators of the document.
public static  intconvertLSToLF(char chars, int len)
     Convert text with generic line separators to line feeds (LF).
public static  StringconvertLSToLF(String text)
     Convert string with generic line separators to line feeds (LF).
public static  char[]createSpacesBuffer(int numSpaces)
     Get buffer of the requested size filled entirely with space character.
public static  char[]createWhiteSpaceFillBuffer(int startCol, int endCol, int tabSize)
     createWhitespaceFillBuffer() with the non-capital 's' should be used.
public static  char[]createWhitespaceFillBuffer(int startCol, int endCol, int tabSize)
     Get buffer filled with spaces/tabs so that it reaches from some column to some other column.
public static  booleanendsWith(char[] chars, char[] suffix)
    
public static  booleanequals(String s, char[] chars)
    
public static  booleanequals(String s, char[] chars, int offset, int len)
    
public static  char[]extract(char[] chars, int offset, int len)
    
public static  intfindFirstLFOffset(char[] chars, int offset, int len)
    
public static  intfindFirstLFOffset(String s)
    
public static  intfindFirstNonSpace(char[] chars, int offset, int len)
    
public static  intfindFirstNonTab(char[] chars, int offset, int len)
    
public static  intfindFirstNonWhite(char[] chars, int offset, int len)
    
public static  intfindFirstTab(char[] chars, int offset, int len)
    
public static  intfindFirstTabOrLF(char[] chars, int offset, int len)
    
public static  intfindLastNonWhite(char[] chars, int offset, int len)
    
public static  intgetColumn(char buffer, int offset, int len, int tabSize, int startCol)
     Get visual column.
public static  StringgetIndentString(int indent, boolean expandTabs, int tabSize)
     Get the string that should be used for indentation of the given level.
public static  intgetLFCount(char chars)
     Count the number of line feeds in char array.
public static  intgetLFCount(char chars, int offset, int len)
    
public static  intgetLFCount(String s)
    
public static  ObjectgetPlatformLS()
    
public static synchronized  char[]getSpacesBuffer(int numSpaces)
     Get buffer filled with appropriate number of spaces.
public static synchronized  StringgetSpacesString(int numSpaces)
     Get string filled with space characters.
public static  char[]getTabsBuffer(int numTabs)
     Get buffer filled with appropriate number of tabs.
public static  StringgetWhitespaceString(int startCol, int endCol, boolean expandTabs, int tabSize)
     Get the string that should be used for indentation of the given level.
public static  voidinitialRead(BaseDocument doc, Reader reader, boolean testLS)
     Do initial reading of document.
public static  booleanisSpace(String s)
    
public static  booleanisSpace(char[] chars, int offset, int len)
    
public static  booleanisWhitespace(char[] chars, int offset, int len)
    
public static  char[]loadFile(String fileName)
     Loads the file and performs conversion of line separators to LF.
static  voidread(BaseDocument doc, Reader reader, int pos)
    
public static  StringremoveSpaces(String s)
     Remove all spaces from the given string.
public static  voidreverse(char[] chars, int len)
     Reverses the order of characters in the array.
public static  booleanstartsWith(char[] chars, char[] prefix)
    
public static  StringtestLS(char chars, int len)
     Test line separator on given semgment.
static  voidwrite(BaseDocument doc, Writer writer, int pos, int len)
    

Field Detail
EMPTY_CHAR_ARRAY
final public static char[] EMPTY_CHAR_ARRAY(Code)
Empty char array





Method Detail
blocksHit
public static boolean blocksHit(int[] blocks, int startPos, int endPos)(Code)



blocksIndex
public static int blocksIndex(int[] blocks, int startPos, int endPos)(Code)



concat
public static char[] concat(char[] chars1, char[] chars2)(Code)



convertLFToLS
public static int convertLFToLS(char[] src, int len, char[] tgt, String lsType)(Code)
Convert text with LF line separators to text that uses line separators of the document. This function is used when saving text into the file. Segment's data are converted inside the segment's data or new segment's data array is allocated. NOTE: Source segment must have just LFs as separators! Otherwise the conversion won't work correctly.
Parameters:
  src - source chars to convert from
Parameters:
  len - length of valid part of src data
Parameters:
  tgt - target chars to convert to. The array MUST have twicethe size of src otherwise index exception can be thrown
Parameters:
  lsType - line separator type to be used i.e. LS_LF, LS_CR, LS_CRLF length of valid chars in tgt array



convertLSToLF
public static int convertLSToLF(char chars, int len)(Code)
Convert text with generic line separators to line feeds (LF). As the linefeeds are one char long there is no need to allocate another buffer since the only possibility is that the returned length will be smaller than previous (if there were some CRLF separators.
Parameters:
  chars - char array with data to convert
Parameters:
  len - valid portion of chars array new valid portion of chars array after conversion



convertLSToLF
public static String convertLSToLF(String text)(Code)
Convert string with generic line separators to line feeds (LF).
Parameters:
  text - string to convert new string with converted LSs to LFs



createSpacesBuffer
public static char[] createSpacesBuffer(int numSpaces)(Code)
Get buffer of the requested size filled entirely with space character.
Parameters:
  numSpaces - number of spaces in the returned character buffer.



createWhiteSpaceFillBuffer
public static char[] createWhiteSpaceFillBuffer(int startCol, int endCol, int tabSize)(Code)
createWhitespaceFillBuffer() with the non-capital 's' should be used.



createWhitespaceFillBuffer
public static char[] createWhitespaceFillBuffer(int startCol, int endCol, int tabSize)(Code)
Get buffer filled with spaces/tabs so that it reaches from some column to some other column.
Parameters:
  startCol - starting visual column of the whitespace on the line
Parameters:
  endCol - ending visual column of the whitespace on the line
Parameters:
  tabSize - size substituted visually for the '\t' character



endsWith
public static boolean endsWith(char[] chars, char[] suffix)(Code)



equals
public static boolean equals(String s, char[] chars)(Code)



equals
public static boolean equals(String s, char[] chars, int offset, int len)(Code)



extract
public static char[] extract(char[] chars, int offset, int len)(Code)



findFirstLFOffset
public static int findFirstLFOffset(char[] chars, int offset, int len)(Code)



findFirstLFOffset
public static int findFirstLFOffset(String s)(Code)



findFirstNonSpace
public static int findFirstNonSpace(char[] chars, int offset, int len)(Code)
Return the first index that is not space



findFirstNonTab
public static int findFirstNonTab(char[] chars, int offset, int len)(Code)
Return the first index that is not space



findFirstNonWhite
public static int findFirstNonWhite(char[] chars, int offset, int len)(Code)
Return the first index that is not space or tab or new-line char



findFirstTab
public static int findFirstTab(char[] chars, int offset, int len)(Code)



findFirstTabOrLF
public static int findFirstTabOrLF(char[] chars, int offset, int len)(Code)



findLastNonWhite
public static int findLastNonWhite(char[] chars, int offset, int len)(Code)
Return the last index that is not space or tab or new-line char



getColumn
public static int getColumn(char buffer, int offset, int len, int tabSize, int startCol)(Code)
Get visual column.



getIndentString
public static String getIndentString(int indent, boolean expandTabs, int tabSize)(Code)
Get the string that should be used for indentation of the given level.
Parameters:
  indent - indentation level
Parameters:
  expandTabs - whether tabs should be expanded to spaces or not
Parameters:
  tabSize - size substituted visually for the '\t' character



getLFCount
public static int getLFCount(char chars)(Code)
Count the number of line feeds in char array. number of LF characters contained in array.



getLFCount
public static int getLFCount(char chars, int offset, int len)(Code)



getLFCount
public static int getLFCount(String s)(Code)



getPlatformLS
public static Object getPlatformLS()(Code)
Get platform default line separator



getSpacesBuffer
public static synchronized char[] getSpacesBuffer(int numSpaces)(Code)
Get buffer filled with appropriate number of spaces. The buffer can have actually more spaces than requested.
Parameters:
  numSpaces - number of spaces



getSpacesString
public static synchronized String getSpacesString(int numSpaces)(Code)
Get string filled with space characters. There is optimization to return the same string instance for up to ceratin number of spaces.
Parameters:
  numSpaces - number of spaces determining the resulting size of the string.



getTabsBuffer
public static char[] getTabsBuffer(int numTabs)(Code)
Get buffer filled with appropriate number of tabs. The buffer can have actually more tabs than requested.
Parameters:
  numSpaces - number of spaces



getWhitespaceString
public static String getWhitespaceString(int startCol, int endCol, boolean expandTabs, int tabSize)(Code)
Get the string that should be used for indentation of the given level.
Parameters:
  indent - indentation level
Parameters:
  expandTabs - whether tabs should be expanded to spaces or not
Parameters:
  tabSize - size of the '\t' character



initialRead
public static void initialRead(BaseDocument doc, Reader reader, boolean testLS) throws IOException(Code)
Do initial reading of document. Translate any line separators found in document to line separators used by document. It also cares for elements that were already created on the empty document. Although the document must be empty there can be already marks created. Initial read is equivalent to inserting the string array of the whole document size at position 0 in the document. Therefore all the marks that are not insertAfter are removed and reinserted to the end of the document after the whole initial read is finished.
Parameters:
  doc - document for which the initialization is performed
Parameters:
  reader - reader from which document should be read
Parameters:
  lsType - line separator type
Parameters:
  testLS - test line separator of file and if it's consistent, use it
Parameters:
  markDistance - the distance between the new syntax mark is put



isSpace
public static boolean isSpace(String s)(Code)



isSpace
public static boolean isSpace(char[] chars, int offset, int len)(Code)
Return true if the array contains only space chars



isWhitespace
public static boolean isWhitespace(char[] chars, int offset, int len)(Code)
Return true if the array contains only space or tab chars



loadFile
public static char[] loadFile(String fileName) throws IOException(Code)
Loads the file and performs conversion of line separators to LF. This method can be used in debuging of syntax scanner or somewhere else.
Parameters:
  fileName - the name of the file to load array of loaded characters with '\n' as line separator



read
static void read(BaseDocument doc, Reader reader, int pos) throws BadLocationException, IOException(Code)
Read from some reader and insert into document



removeSpaces
public static String removeSpaces(String s)(Code)
Remove all spaces from the given string.
Parameters:
  s - original string string with all spaces removed



reverse
public static void reverse(char[] chars, int len)(Code)
Reverses the order of characters in the array. It works from the begining of the array, so no offset is given.



startsWith
public static boolean startsWith(char[] chars, char[] prefix)(Code)



testLS
public static String testLS(char chars, int len)(Code)
Test line separator on given semgment. This implementation simply checks the first line of file but it can be redefined to do more thorough test.
Parameters:
  seg - segment where analyzes are performed line separator type found in the file



write
static void write(BaseDocument doc, Writer writer, int pos, int len) throws BadLocationException, IOException(Code)
Write from document to some writer



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.