Java Doc for StreamTokenizer.java in  » Apache-Harmony-Java-SE » java-package » java » io » 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 » Apache Harmony Java SE » java package » java.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.StreamTokenizer

StreamTokenizer
public class StreamTokenizer (Code)
StreamTokenizer takes a stream and a set of tokens and parses them one at a time. The different types of tokens that can be found are numbers, identifiers, quoted strings, and different comment styles.


Field Summary
final public static  intTT_EOF
     The constant representing end of stream.
final public static  intTT_EOL
     The constant representing end of line.
final public static  intTT_NUMBER
     The constant representing a number token.
final public static  intTT_WORD
     The constant representing a word token.
public  doublenval
    
public  Stringsval
    
public  intttype
    

Constructor Summary
public  StreamTokenizer(InputStream is)
     Construct a new StreamTokenizer on the InputStream is.
public  StreamTokenizer(Reader r)
     Construct a new StreamTokenizer on the Reader r. Initialize the default state per specification.
  • All byte values 'A' through 'Z', 'a' through 'z', and '\u00A0' through '\u00FF' are considered to be alphabetic.
  • All byte values '\u0000' through '\u0020' are considered to be white space.

Method Summary
public  voidcommentChar(int ch)
     Set the character ch to be regarded as a comment character.
public  voideolIsSignificant(boolean flag)
     Set a boolean indicating whether or not end of line is significant and should be returned as TT_EOF in ttype.
public  intlineno()
     Answer the current line number.
public  voidlowerCaseMode(boolean flag)
     Set a boolean indicating whether or not tokens should be uppercased when present in sval.
public  intnextToken()
     Answer the next token type.
public  voidordinaryChar(int ch)
     Set the character ch to be regarded as an ordinary character.
public  voidordinaryChars(int low, int hi)
     Set the characters ranging from low to hi to be regarded as ordinary characters.
public  voidparseNumbers()
     Indicate that numbers should be parsed.
public  voidpushBack()
     Indicate that the current token should be pushed back and returned the next time nextToken() is called.
public  voidquoteChar(int ch)
     Set the character ch to be regarded as a quote character.
public  voidresetSyntax()
     Reset all characters so that they are ordinary.
public  voidslashSlashComments(boolean flag)
     Set a boolean indicating whether or not slash slash comments should be recognized.
public  voidslashStarComments(boolean flag)
     Set a boolean indicating whether or not slash star comments should be recognized.
public  StringtoString()
     Answer the state of this tokenizer in a readable format.
public  voidwhitespaceChars(int low, int hi)
     Set the characters ranging from low to hi to be regarded as whitespace characters.
public  voidwordChars(int low, int hi)
     Set the characters ranging from low to hi to be regarded as word characters.

Field Detail
TT_EOF
final public static int TT_EOF(Code)
The constant representing end of stream.



TT_EOL
final public static int TT_EOL(Code)
The constant representing end of line.



TT_NUMBER
final public static int TT_NUMBER(Code)
The constant representing a number token.



TT_WORD
final public static int TT_WORD(Code)
The constant representing a word token.



nval
public double nval(Code)
Contains a number if the current token is a number (ttype is TT_NUMBER)



sval
public String sval(Code)
Contains a string if the current token is a word (ttype is TT_WORD)



ttype
public int ttype(Code)
The token type




Constructor Detail
StreamTokenizer
public StreamTokenizer(InputStream is)(Code)
Construct a new StreamTokenizer on the InputStream is. This usage of this method should be replaced with the constructor which takes a Reader.
Parameters:
  is - The InputStream to parse tokens on.



StreamTokenizer
public StreamTokenizer(Reader r)(Code)
Construct a new StreamTokenizer on the Reader r. Initialize the default state per specification.
  • All byte values 'A' through 'Z', 'a' through 'z', and '\u00A0' through '\u00FF' are considered to be alphabetic.
  • All byte values '\u0000' through '\u0020' are considered to be white space. '/' is a comment character.
  • Single quote '\'' and double quote '"' are string quote characters.
  • Numbers are parsed.
  • Ends of lines are considered to be white space rather than separate tokens.
  • C-style and C++-style comments are not recognized.
These are the defaults and are not needed in constructor.
Parameters:
  r - The InputStream to parse tokens on.




Method Detail
commentChar
public void commentChar(int ch)(Code)
Set the character ch to be regarded as a comment character.
Parameters:
  ch - The character to be considered a comment character.



eolIsSignificant
public void eolIsSignificant(boolean flag)(Code)
Set a boolean indicating whether or not end of line is significant and should be returned as TT_EOF in ttype.
Parameters:
  flag - true if EOL is significant, falseotherwise.



lineno
public int lineno()(Code)
Answer the current line number. the current line number.



lowerCaseMode
public void lowerCaseMode(boolean flag)(Code)
Set a boolean indicating whether or not tokens should be uppercased when present in sval.
Parameters:
  flag - true if sval should be forceduppercase, false otherwise.



nextToken
public int nextToken() throws IOException(Code)
Answer the next token type. The next token to be parsed.
throws:
  IOException - If an IO error occurs while getting the token



ordinaryChar
public void ordinaryChar(int ch)(Code)
Set the character ch to be regarded as an ordinary character.
Parameters:
  ch - The character to be considered an ordinary comment character.



ordinaryChars
public void ordinaryChars(int low, int hi)(Code)
Set the characters ranging from low to hi to be regarded as ordinary characters.
Parameters:
  low - The starting range for ordinary characters.
Parameters:
  hi - The ending range for ordinary characters.



parseNumbers
public void parseNumbers()(Code)
Indicate that numbers should be parsed.



pushBack
public void pushBack()(Code)
Indicate that the current token should be pushed back and returned the next time nextToken() is called.



quoteChar
public void quoteChar(int ch)(Code)
Set the character ch to be regarded as a quote character.
Parameters:
  ch - The character to be considered a quote comment character.



resetSyntax
public void resetSyntax()(Code)
Reset all characters so that they are ordinary.



slashSlashComments
public void slashSlashComments(boolean flag)(Code)
Set a boolean indicating whether or not slash slash comments should be recognized. The comment ends at a new line.
Parameters:
  flag - true if // should be recognizedas the start of a comment, false otherwise.



slashStarComments
public void slashStarComments(boolean flag)(Code)
Set a boolean indicating whether or not slash star comments should be recognized. Slash-star comments cannot be nested and end when a star-slash combination is found.
Parameters:
  flag - true if /* should be recognizedas the start of a comment, false otherwise.



toString
public String toString()(Code)
Answer the state of this tokenizer in a readable format. The current state of this tokenizer.



whitespaceChars
public void whitespaceChars(int low, int hi)(Code)
Set the characters ranging from low to hi to be regarded as whitespace characters.
Parameters:
  low - The starting range for whitespace characters.
Parameters:
  hi - The ending range for whitespace characters.



wordChars
public void wordChars(int low, int hi)(Code)
Set the characters ranging from low to hi to be regarded as word characters.
Parameters:
  low - The starting range for word characters.
Parameters:
  hi - The ending range for word characters.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.