Java Doc for Scanner.java in  » Web-Server » Quadcap-Web-Server » com » quadcap » util » text » 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 » Quadcap Web Server » com.quadcap.util.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.quadcap.util.text.Scanner

Scanner
public class Scanner (Code)
The class implements a series of low-level stream scanning operations, using OctetMaps to implement 'while' and 'until'.
author:
   Stan Bailes


Field Summary
 ByteArrayOutputStreambos
    
 InputStreamis
    
 LogInputStreamlog
    
 intpushback
    
 StringBuffersb
    

Constructor Summary
public  Scanner(InputStream is, boolean saveit)
    
public  Scanner(InputStream is)
     Construct a new scanner, attached to the specified input stream.

Method Summary
public static  intcopyUntil(InputStream is, OutputStream os, OctetMap map)
     Copy bytes from an input stream to an output stream until a byte in the specified set is found.
public static  intcopyUntil(InputStream is, OutputStream os, int dc)
    
public static  intcopyUntil(BufferedInputStream is, OutputStream os, String s)
     Copy bytes from in to out until the specified string is is.read from in
public static  intcopyWhile(InputStream is, OutputStream os, OctetMap map)
     Copy bytes from an input stream to an output stream until a byte not in the specified set is found.
public  StringgetLog()
    
final public  voidmatchChar(int expected)
     Read the next character, and verify that it is equal to the expected value.
final public  voidmatchString(OctetMap map, String expected)
     Read the next string using the specified map, and verify that it IS equal to the expected value.
final public  voidmatchStringIgnoreCase(OctetMap map, String expected)
     Read the next string using the specified map, and verify that it IS equal to the expected value, if all characters in both strings are converted to monocase.
final public  StringparseUntil(OctetMap map)
     Return the next portion of the stream which consists of characters NOT IN the specified set.
final public  StringparseWhile(OctetMap map)
     Return the next portion of the stream which consists of characters IN the specified set.
final public  intpeek()
     Peek ahead one character in the stream by reading, then pushing back the character.
final  intread()
    
public  voidreset(InputStream is)
    
final public  voidskipUntil(OctetMap map)
     Read and discard characters until a character is found which is in the map.
final public  voidskipWhile(OctetMap map)
     Read and discard characters until a character is found which is not in the map.
public static  intskipWhile(InputStream is, int dc)
     Read and discard characters until a character is found which is not equal to the specified character.
final  voidunread(int c)
    

Field Detail
bos
ByteArrayOutputStream bos(Code)



is
InputStream is(Code)



log
LogInputStream log(Code)



pushback
int pushback(Code)



sb
StringBuffer sb(Code)




Constructor Detail
Scanner
public Scanner(InputStream is, boolean saveit)(Code)



Scanner
public Scanner(InputStream is)(Code)
Construct a new scanner, attached to the specified input stream.
Parameters:
  is - the stream to scan.




Method Detail
copyUntil
public static int copyUntil(InputStream is, OutputStream os, OctetMap map) throws IOException(Code)
Copy bytes from an input stream to an output stream until a byte in the specified set is found. That byte is returned, or -1 the end of file is reached.
Parameters:
  is - the input stream from which bytes are is.read
Parameters:
  os - the output stream to which bytes are written
Parameters:
  map - the set of valid delimiter bytes the first matching byte
exception:
  IOException - may be thrown



copyUntil
public static int copyUntil(InputStream is, OutputStream os, int dc) throws IOException(Code)



copyUntil
public static int copyUntil(BufferedInputStream is, OutputStream os, String s) throws IOException(Code)
Copy bytes from in to out until the specified string is is.read from inout
Parameters:
  is - the input stream from which bytes are is.read
Parameters:
  os - the output stream to which bytes are written
Parameters:
  s - the delimiter string < 0 if end of file is reached before the string is found,>= 0 otherwise
exception:
  IOException - may be thrown



copyWhile
public static int copyWhile(InputStream is, OutputStream os, OctetMap map) throws IOException(Code)
Copy bytes from an input stream to an output stream until a byte not in the specified set is found. That byte is returned, or -1 the end of file is reached.
Parameters:
  is - the input stream from which bytes are is.read
Parameters:
  os - the output stream to which bytes are written
Parameters:
  map - the set of valid byte to copy the first non matching byte
exception:
  IOException - may be thrown



getLog
public String getLog()(Code)



matchChar
final public void matchChar(int expected) throws IOException(Code)
Read the next character, and verify that it is equal to the expected value.
Parameters:
  expected - the expected character
exception:
  IOException - if the character read from the stream is notequal to the specified character.



matchString
final public void matchString(OctetMap map, String expected) throws IOException(Code)
Read the next string using the specified map, and verify that it IS equal to the expected value.
Parameters:
  expected - the expected string
exception:
  IOException - if the character read from the stream is notequal to the specified character.



matchStringIgnoreCase
final public void matchStringIgnoreCase(OctetMap map, String expected) throws IOException(Code)
Read the next string using the specified map, and verify that it IS equal to the expected value, if all characters in both strings are converted to monocase.
Parameters:
  expected - the expected string
exception:
  IOException - if the character read from the stream is notequal to the specified character.



parseUntil
final public String parseUntil(OctetMap map) throws IOException(Code)
Return the next portion of the stream which consists of characters NOT IN the specified set.
Parameters:
  map - the set of characters to parse.
exception:
  IOException - if an I/O exception is thrown



parseWhile
final public String parseWhile(OctetMap map) throws IOException(Code)
Return the next portion of the stream which consists of characters IN the specified set.
Parameters:
  map - the set of characters to parse.
exception:
  IOException - if an I/O exception is thrown



peek
final public int peek() throws IOException(Code)
Peek ahead one character in the stream by reading, then pushing back the character. the next character from the stream.
exception:
  IOException - if an exception is thrown when the characteris read.



read
final int read() throws IOException(Code)



reset
public void reset(InputStream is)(Code)



skipUntil
final public void skipUntil(OctetMap map) throws IOException(Code)
Read and discard characters until a character is found which is in the map. Then push back the terminating character.
Parameters:
  map - the set of characters which skip.
exception:
  IOException - if an I/O exception is thrown



skipWhile
final public void skipWhile(OctetMap map) throws IOException(Code)
Read and discard characters until a character is found which is not in the map. Then push back the terminating character.
Parameters:
  map - the set of characters to skip.
exception:
  IOException - if an I/O exception is thrown



skipWhile
public static int skipWhile(InputStream is, int dc) throws IOException(Code)
Read and discard characters until a character is found which is not equal to the specified character. Return the terminating character.
Parameters:
  dc - the character to discard
exception:
  IOException - if an I/O exception is thrown



unread
final void unread(int c)(Code)



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.