Java Doc for ParseBuffer.java in  » Web-Server » simple » simple » util » parse » 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 » Web Server » simple » simple.util.parse 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   simple.util.parse.ParseBuffer

All known Subclasses:   simple.page.translate.TokenBuffer,  simple.page.translate.Parser,  simple.util.parse.PropertyBuffer,
ParseBuffer
public class ParseBuffer implements Serializable(Code)
This is primarily used to replace the StringBuffer class, as a way for the Parser to store the char's for a specific region within the parse data that constitutes a desired value. The methods are not synchronized so it enables the char's to be taken quicker than the StringBuffer class.
author:
   Niall Gallagher


Field Summary
protected  char[]buf
     The char's this buffer accumulated.
protected  Stringcache
     This is used to quicken toString.
protected  intcount
     This is the number of char's stored.

Constructor Summary
public  ParseBuffer()
     Constructor for ParseBuffer.
public  ParseBuffer(int size)
     This creates a ParseBuffer with a specific default size.

Method Summary
public  voidappend(char c)
     This will add a char to the end of the buffer.
public  voidappend(String str)
     This will add a String to the end of the buffer.
public  voidappend(ParseBuffer text)
     This will add a ParseBuffer to the end of this.
public  voidappend(char[] c, int off, int len)
     This will add a char to the end of the buffer.
public  voidappend(String str, int off, int len)
     This will add a String to the end of the buffer.
public  voidappend(ParseBuffer text, int off, int len)
     This will add a ParseBuffer to the end of this.
public  voidclear()
     This will empty the ParseBuffer so that the toString paramater will return null.
protected  voidensureCapacity(int min)
     This ensure that there is enough space in the buffer to allow for more char's to be added.
public  intlength()
     This will return the number of bytes that have been appended to the ParseBuffer.
public  StringtoString()
     This will return the characters that have been appended to the ParseBuffer as a String object. If the String object has been created before then a cached String object will be returned.

Field Detail
buf
protected char[] buf(Code)
The char's this buffer accumulated.



cache
protected String cache(Code)
This is used to quicken toString.



count
protected int count(Code)
This is the number of char's stored.




Constructor Detail
ParseBuffer
public ParseBuffer()(Code)
Constructor for ParseBuffer. The default ParseBuffer stores 16 char's before a resize is needed to accomodate extra characters.



ParseBuffer
public ParseBuffer(int size)(Code)
This creates a ParseBuffer with a specific default size. The buffer will be created the with the length specified. The ParseBuffer can grow to accomodate a collection of char's larger the the size spacified.
Parameters:
  size - initial size of this ParseBuffer




Method Detail
append
public void append(char c)(Code)
This will add a char to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate more char's.
Parameters:
  c - the char to be appended



append
public void append(String str)(Code)
This will add a String to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large String objects.
Parameters:
  str - the String to be appended to this



append
public void append(ParseBuffer text)(Code)
This will add a ParseBuffer to the end of this. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large ParseBuffer objects.
Parameters:
  text - the ParseBuffer to be appended



append
public void append(char[] c, int off, int len)(Code)
This will add a char to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large char arrays.
Parameters:
  c - the char array to be appended to this
Parameters:
  off - the read offset for the array
Parameters:
  len - the number of char's to add



append
public void append(String str, int off, int len)(Code)
This will add a String to the end of the buffer. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large String objects.
Parameters:
  str - the String to be appended to this
Parameters:
  off - the read offset for the String
Parameters:
  len - the number of char's to add



append
public void append(ParseBuffer text, int off, int len)(Code)
This will add a ParseBuffer to the end of this. The buffer will not overflow with repeated uses of the append, it uses an ensureCapacity method which will allow the buffer to dynamically grow in size to accomodate large ParseBuffer objects.
Parameters:
  text - the ParseBuffer to be appended
Parameters:
  off - the read offset for the ParseBuffer
Parameters:
  len - the number of char's to add



clear
public void clear()(Code)
This will empty the ParseBuffer so that the toString paramater will return null. This is used so that the same ParseBuffer can be recycled for different tokens.



ensureCapacity
protected void ensureCapacity(int min)(Code)
This ensure that there is enough space in the buffer to allow for more char's to be added. If the buffer is already larger than min then the buffer will not be expanded at all.
Parameters:
  min - the minimum size needed



length
public int length()(Code)
This will return the number of bytes that have been appended to the ParseBuffer. This will return zero after the clear method has been invoked. the number of char's within the buffer



toString
public String toString()(Code)
This will return the characters that have been appended to the ParseBuffer as a String object. If the String object has been created before then a cached String object will be returned. This method will return null after clear is invoked. the char's appended as a String



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.