Java Doc for RegexpPool.java in  » 6.0-JDK-Modules » j2me » sun » misc » 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 » 6.0 JDK Modules » j2me » sun.misc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sun.misc.RegexpPool

RegexpPool
public class RegexpPool (Code)
A class to represent a pool of regular expressions. A string can be matched against the whole pool all at once. It is much faster than doing individual regular expression matches one-by-one.
See Also:   java.misc.RegexpTarget
author:
   James Gosling



Constructor Summary
public  RegexpPool()
    

Method Summary
public  voidadd(String re, Object ret)
     Add a regular expression to the pool of regular expressions.
Parameters:
  re - The regular expression to add to the pool.For now, only handles strings that either begin or end witha '*'.
Parameters:
  ret - The object to be returned when this regular expression ismatched.
public  Objectdelete(String re)
     Delete the regular expression and its target.
public static  voidmain(String argv)
    
public  Objectmatch(String s)
     Search for a match to a string & return the object associated with it with the match.
public  ObjectmatchNext(String s)
    
public  voidprint(PrintStream out)
    
public  voidreplace(String re, Object ret)
     Replace the target for the regular expression with a different target.
Parameters:
  re - The regular expression to be replaced in the pool.For now, only handles strings that either begin or end witha '*'.
Parameters:
  ret - The object to be returned when this regular expression ismatched.
public  voidreset()
     Resets the pool so that the next call to matchNext looks at all regular expressions in the pool.


Constructor Detail
RegexpPool
public RegexpPool()(Code)




Method Detail
add
public void add(String re, Object ret) throws REException(Code)
Add a regular expression to the pool of regular expressions.
Parameters:
  re - The regular expression to add to the pool.For now, only handles strings that either begin or end witha '*'.
Parameters:
  ret - The object to be returned when this regular expression ismatched. If ret is an instance of the RegexpTarget class, ret.foundis called with the string fragment that matched the '*' as its parameter.
exception:
  REException - error



delete
public Object delete(String re)(Code)
Delete the regular expression and its target.
Parameters:
  re - The regular expression to be deleted from the pool.must begin or end with a '*' target - the old target.



main
public static void main(String argv)(Code)



match
public Object match(String s)(Code)
Search for a match to a string & return the object associated with it with the match. When multiple regular expressions would match the string, the best match is returned first. The next best match is returned the next time matchNext is called.
Parameters:
  s - The string to match against the regular expressionsin the pool. null on failure, otherwise the object associated withthe regular expression when it was added to the pool.If the object is an instance of RegexpTarget, thenthe return value is the result from callingreturn.found(string_that_matched_wildcard).



matchNext
public Object matchNext(String s)(Code)
Identical to match except that it will only find matches to regular expressions that were added to the pool after the last regular expression that matched in the last call to match() or matchNext()



print
public void print(PrintStream out)(Code)
Print this pool to standard output



replace
public void replace(String re, Object ret)(Code)
Replace the target for the regular expression with a different target.
Parameters:
  re - The regular expression to be replaced in the pool.For now, only handles strings that either begin or end witha '*'.
Parameters:
  ret - The object to be returned when this regular expression ismatched. If ret is an instance of the RegexpTarget class, ret.foundis called with the string fragment that matched the '*' as its parameter.



reset
public void reset()(Code)
Resets the pool so that the next call to matchNext looks at all regular expressions in the pool. match(s); is equivalent to reset(); matchNext(s);

Multithreading note: reset/nextMatch leave state in the regular expression pool. If multiple threads could be using this pool this way, they should be syncronized to avoid race hazards. match() was done in such a way that there are no such race hazards: multiple threads can be matching in the same pool simultaneously.




Methods inherited from java.lang.Object
public boolean equals(Object obj)(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.