Java Doc for ParseText.java in  » HTML-Parser » jericho-html » au » id » jericho » lib » html » 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 » HTML Parser » jericho html » au.id.jericho.lib.html 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   au.id.jericho.lib.html.ParseText

ParseText
final public class ParseText implements CharSequence(Code)
Represents the text from the document that is to be parsed.

This class is normally only of interest to users who wish to create custom tag types.

The parse text is defined as the entire text of the source document in lower case, with all segments replaced by space characters.

The text is stored in lower case to make case insensitive parsing as efficient as possible.

This class provides many methods which are also provided by the java.lang.String class, but adds an extra parameter called breakAtIndex to the various indexOf methods. This parameter allows a search on only a specified segment of the text, which is not possible using the normal String class.

ParseText instances are obtained using the Source.getParseText method.



Field Summary
final public static  intNO_BREAK
     A value to use as the breakAtIndex argument in certain methods to indicate that the search should continue to the start or end of the parse text.

Constructor Summary
 ParseText(CharSequence charSequence)
     Constructs a new ParseText object based on the specified CharSequence.
 ParseText(OutputDocument outputDocument)
     Constructs a new ParseText object based on the specified OutputDocument .

Method Summary
public  charcharAt(int index)
     Returns the character at the specified index.
Parameters:
  index - the index of the character.
public  booleancontainsAt(String str, int pos)
     Indicates whether this parse text contains the specified string at the specified position.

This method is analogous to the java.lang.String.startsWith(String prefix, int toffset) method.
Parameters:
  str - a string.
Parameters:
  pos - the position (index) in this parse text at which to check for the specified string.

public  intindexOf(char searchChar, int fromIndex)
     Returns the index within this parse text of the first occurrence of the specified character, starting the search at the position specified by fromIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from.

public  intindexOf(char searchChar, int fromIndex, int breakAtIndex)
     Returns the index within this parse text of the first occurrence of the specified character, starting the search at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the end of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the end of the text.

public  intindexOf(String searchString, int fromIndex)
     Returns the index within this parse text of the first occurrence of the specified string, starting the search at the position specified by fromIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from.

public  intindexOf(char[] searchCharArray, int fromIndex)
     Returns the index within this parse text of the first occurrence of the specified character array, starting the search at the position specified by fromIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from.

public  intindexOf(String searchString, int fromIndex, int breakAtIndex)
     Returns the index within this parse text of the first occurrence of the specified string, starting the search at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the end of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the end of the text.

public  intindexOf(char[] searchCharArray, int fromIndex, int breakAtIndex)
     Returns the index within this parse text of the first occurrence of the specified character array, starting the search at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the end of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the end of the text.

public  intlastIndexOf(char searchChar, int fromIndex)
     Returns the index within this parse text of the last occurrence of the specified character, searching backwards starting at the position specified by fromIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from.

public  intlastIndexOf(char searchChar, int fromIndex, int breakAtIndex)
     Returns the index within this parse text of the last occurrence of the specified character, searching backwards starting at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the start of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the start of the text.

public  intlastIndexOf(String searchString, int fromIndex)
     Returns the index within this parse text of the last occurrence of the specified string, searching backwards starting at the position specified by fromIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from.

public  intlastIndexOf(char[] searchCharArray, int fromIndex)
     Returns the index within this parse text of the last occurrence of the specified character array, searching backwards starting at the position specified by fromIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from.

public  intlastIndexOf(String searchString, int fromIndex, int breakAtIndex)
     Returns the index within this parse text of the last occurrence of the specified string, searching backwards starting at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the start of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the start of the text.

public  intlastIndexOf(char[] searchCharArray, int fromIndex, int breakAtIndex)
     Returns the index within this parse text of the last occurrence of the specified character array, searching backwards starting at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the start of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the start of the text.

public  intlength()
     Returns the length of the parse text.
public  CharSequencesubSequence(int beginIndex, int endIndex)
     Returns a new character sequence that is a subsequence of this sequence.

This is equivalent to ParseText.substring(int,int) substring(beginIndex,endIndex) .
Parameters:
  beginIndex - the begin index, inclusive.
Parameters:
  endIndex - the end index, exclusive.

public  Stringsubstring(int beginIndex, int endIndex)
     Returns a new string that is a substring of this parse text.

The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.

public  StringtoString()
     Returns the content of the parse text as a String.

Field Detail
NO_BREAK
final public static int NO_BREAK(Code)
A value to use as the breakAtIndex argument in certain methods to indicate that the search should continue to the start or end of the parse text.




Constructor Detail
ParseText
ParseText(CharSequence charSequence)(Code)
Constructs a new ParseText object based on the specified CharSequence.
Parameters:
  charSequence - the character sequence upon which the parse text is based.



ParseText
ParseText(OutputDocument outputDocument)(Code)
Constructs a new ParseText object based on the specified OutputDocument .
Parameters:
  outputDocument - the OutputDocument upon which the parse text is based.




Method Detail
charAt
public char charAt(int index)(Code)
Returns the character at the specified index.
Parameters:
  index - the index of the character. the character at the specified index, which is always in lower case.



containsAt
public boolean containsAt(String str, int pos)(Code)
Indicates whether this parse text contains the specified string at the specified position.

This method is analogous to the java.lang.String.startsWith(String prefix, int toffset) method.
Parameters:
  str - a string.
Parameters:
  pos - the position (index) in this parse text at which to check for the specified string. true if this parse text contains the specified string at the specified position, otherwise false.




indexOf
public int indexOf(char searchChar, int fromIndex)(Code)
Returns the index within this parse text of the first occurrence of the specified character, starting the search at the position specified by fromIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from. the index within this parse text of the first occurrence of the specified character within the specified range, or -1 if the character is not found.




indexOf
public int indexOf(char searchChar, int fromIndex, int breakAtIndex)(Code)
Returns the index within this parse text of the first occurrence of the specified character, starting the search at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the end of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the end of the text. the index within this parse text of the first occurrence of the specified character within the specified range, or -1 if the character is not found.




indexOf
public int indexOf(String searchString, int fromIndex)(Code)
Returns the index within this parse text of the first occurrence of the specified string, starting the search at the position specified by fromIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from. the index within this parse text of the first occurrence of the specified string within the specified range, or -1 if the string is not found.




indexOf
public int indexOf(char[] searchCharArray, int fromIndex)(Code)
Returns the index within this parse text of the first occurrence of the specified character array, starting the search at the position specified by fromIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from. the index within this parse text of the first occurrence of the specified character array within the specified range, or -1 if the character array is not found.




indexOf
public int indexOf(String searchString, int fromIndex, int breakAtIndex)(Code)
Returns the index within this parse text of the first occurrence of the specified string, starting the search at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the end of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the end of the text. the index within this parse text of the first occurrence of the specified string within the specified range, or -1 if the string is not found.




indexOf
public int indexOf(char[] searchCharArray, int fromIndex, int breakAtIndex)(Code)
Returns the index within this parse text of the first occurrence of the specified character array, starting the search at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the end of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the end of the text. the index within this parse text of the first occurrence of the specified character array within the specified range, or -1 if the character array is not found.




lastIndexOf
public int lastIndexOf(char searchChar, int fromIndex)(Code)
Returns the index within this parse text of the last occurrence of the specified character, searching backwards starting at the position specified by fromIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from. the index within this parse text of the last occurrence of the specified character within the specified range, or -1 if the character is not found.




lastIndexOf
public int lastIndexOf(char searchChar, int fromIndex, int breakAtIndex)(Code)
Returns the index within this parse text of the last occurrence of the specified character, searching backwards starting at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the start of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character is not found then -1 is returned.
Parameters:
  searchChar - a character.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the start of the text. the index within this parse text of the last occurrence of the specified character within the specified range, or -1 if the character is not found.




lastIndexOf
public int lastIndexOf(String searchString, int fromIndex)(Code)
Returns the index within this parse text of the last occurrence of the specified string, searching backwards starting at the position specified by fromIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from. the index within this parse text of the last occurrence of the specified string within the specified range, or -1 if the string is not found.




lastIndexOf
public int lastIndexOf(char[] searchCharArray, int fromIndex)(Code)
Returns the index within this parse text of the last occurrence of the specified character array, searching backwards starting at the position specified by fromIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from. the index within this parse text of the last occurrence of the specified character array within the specified range, or -1 if the character array is not found.




lastIndexOf
public int lastIndexOf(String searchString, int fromIndex, int breakAtIndex)(Code)
Returns the index within this parse text of the last occurrence of the specified string, searching backwards starting at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the start of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified string is not found then -1 is returned.
Parameters:
  searchString - a string.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the start of the text. the index within this parse text of the last occurrence of the specified string within the specified range, or -1 if the string is not found.




lastIndexOf
public int lastIndexOf(char[] searchCharArray, int fromIndex, int breakAtIndex)(Code)
Returns the index within this parse text of the last occurrence of the specified character array, searching backwards starting at the position specified by fromIndex, and breaking the search at the index specified by breakAtIndex.

The position specified by breakAtIndex is not included in the search.

If the search is to continue to the start of the text, the value ParseText.NO_BREAK ParseText.NO_BREAK should be specified as the breakAtIndex.

If the specified character array is not found then -1 is returned.
Parameters:
  searchCharArray - a character array.
Parameters:
  fromIndex - the index to start the search from.
Parameters:
  breakAtIndex - the index at which to break off the search, or ParseText.NO_BREAK if the search is to continue to the start of the text. the index within this parse text of the last occurrence of the specified character array within the specified range, or -1 if the character array is not found.




length
public int length()(Code)
Returns the length of the parse text. the length of the parse text.



subSequence
public CharSequence subSequence(int beginIndex, int endIndex)(Code)
Returns a new character sequence that is a subsequence of this sequence.

This is equivalent to ParseText.substring(int,int) substring(beginIndex,endIndex) .
Parameters:
  beginIndex - the begin index, inclusive.
Parameters:
  endIndex - the end index, exclusive. a new character sequence that is a subsequence of this sequence.




substring
public String substring(int beginIndex, int endIndex)(Code)
Returns a new string that is a substring of this parse text.

The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.
Parameters:
  beginIndex - the begin index, inclusive.
Parameters:
  endIndex - the end index, exclusive. a new string that is a substring of this parse text.




toString
public String toString()(Code)
Returns the content of the parse text as a String. the content of the parse text 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.