Java Doc for Segment.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.Segment

All known Subclasses:   au.id.jericho.lib.html.CharacterReference,  au.id.jericho.lib.html.Element,  au.id.jericho.lib.html.FormControl,  au.id.jericho.lib.html.nodoc.SequentialListSegment,  au.id.jericho.lib.html.Attribute,  au.id.jericho.lib.html.Source,  au.id.jericho.lib.html.Tag,
Segment
public class Segment implements Comparable,CharSequence(Code)
Represents a segment of a Source document.

Many of the tag search methods are defined in this class.

The span of a segment is defined by the combination of its begin and end character positions.



Field Summary
final  intbegin
    
 ListchildElements
    
final  intend
    
final  Sourcesource
    

Constructor Summary
public  Segment(Source source, int begin, int end)
     Constructs a new Segment within the specified document with the specified begin and end character positions.
 Segment(int length)
    
 Segment()
    

Method Summary
final static  StringBufferappendCollapseWhiteSpace(StringBuffer sb, CharSequence text)
     Collapses the in the specified text.
final public  charcharAt(int index)
     Returns the character at the specified index.

This is logically equivalent to toString().charAt(index) for valid argument values 0 <= index < length().

However because this implementation works directly on the underlying document source string, it should not be assumed that an IndexOutOfBoundsException is thrown for an invalid argument value.
Parameters:
  index - the index of the character.

public  intcompareTo(Object o)
     Compares this Segment object to another object.
final public  booleanencloses(Segment segment)
     Indicates whether this Segment encloses the specified Segment.

This is the case if Segment.getBegin() <=segment. Segment.getBegin() && Segment.getEnd() >=segment. Segment.getEnd() .
Parameters:
  segment - the segment to be tested for being enclosed by this segment.

final public  booleanencloses(int pos)
     Indicates whether this segment encloses the specified character position in the source document.

This is the case if Segment.getBegin() <= pos < Segment.getEnd() .
Parameters:
  pos - the position in the Source document.

final public  booleanequals(Object object)
     Compares the specified object with this Segment for equality.

Returns true if and only if the specified object is also a Segment, and both segments have the same Source , and the same begin and end positions.
Parameters:
  object - the object to be compared for equality with this Segment.

public  StringextractText()
     Extracts the textual content from the HTML markup of this segment.
public  StringextractText(boolean includeAttributes)
     Extracts the textual content from the HTML markup of this segment.

This method has been deprecated as of version 2.4 and replaced with the Segment.getTextExtractor() method.
Parameters:
  includeAttributes - specifies whether the values of title, alt, label, and summary attributes are included in the output.

public  ListfindAllCharacterReferences()
     Returns a list of all CharacterReference objects that are by this segment.
public  ListfindAllElements()
     Returns a list of all Element objects that are by this segment.
public  ListfindAllElements(String name)
     Returns a list of all Element objects with the specified name that are by this segment.

The elements returned correspond exactly with the start tags returned in the Segment.findAllStartTags(String name) method.

Specifying a null argument to the name parameter is equivalent to Segment.findAllElements() .

This method also returns elements consisting of tags if the specified name is not a valid .
Parameters:
  name - the of the elements to find.

public  ListfindAllElements(StartTagType startTagType)
     Returns a list of all Element objects with start tags of the specified that are by this segment.

The elements returned correspond exactly with the start tags returned in the Segment.findAllTags(TagType) method.
Parameters:
  startTagType - the of start tags to find, must not be null.

public  ListfindAllElements(String attributeName, String value, boolean valueCaseSensitive)
     Returns a list of all Element objects with the specified attribute name/value pair that are by this segment.

The elements returned correspond exactly with the start tags returned in the Segment.findAllStartTags(String attributeName,String value,boolean valueCaseSensitive) method.
Parameters:
  attributeName - the attribute name (case insensitive) to search for, must not be null.
Parameters:
  value - the value of the specified attribute to search for, must not be null.
Parameters:
  valueCaseSensitive - specifies whether the attribute value matching is case sensitive.

public  ListfindAllStartTags()
     Returns a list of all StartTag objects that are by this segment.
public  ListfindAllStartTags(String name)
     Returns a list of all StartTag objects with the specified name that are by this segment.

See the Tag class documentation for more details about the behaviour of this method.

Specifying a null argument to the name parameter is equivalent to Segment.findAllStartTags() .

This method also returns tags if the specified name is not a valid .
Parameters:
  name - the of the start tags to find.

public  ListfindAllStartTags(String attributeName, String value, boolean valueCaseSensitive)
     Returns a list of all StartTag objects with the specified attribute name/value pair that are by this segment.

See the Tag class documentation for more details about the behaviour of this method.
Parameters:
  attributeName - the attribute name (case insensitive) to search for, must not be null.
Parameters:
  value - the value of the specified attribute to search for, must not be null.
Parameters:
  valueCaseSensitive - specifies whether the attribute value matching is case sensitive.

public  ListfindAllTags()
     Returns a list of all Tag objects that are by this segment.
public  ListfindAllTags(TagType tagType)
     Returns a list of all Tag objects of the specified that are by this segment.

See the Tag class documentation for more details about the behaviour of this method.

Specifying a null argument to the tagType parameter is equivalent to Segment.findAllTags() .
Parameters:
  tagType - the of tags to find.

public  ListfindFormControls()
     Returns a list of the FormControl objects that are by this segment.
public  FormFieldsfindFormFields()
     Returns the FormFields object representing all form fields that are by this segment.
final public  intgetBegin()
     Returns the character position in the Source document at which this segment begins.
public  ListgetChildElements()
     Returns a list of the immediate children of this segment in the document element hierarchy.
public  StringgetDebugInfo()
     Returns a string representation of this object useful for debugging purposes.
final public  intgetEnd()
     Returns the character position in the Source document immediately after the end of this segment.
public  RenderergetRenderer()
     Performs a simple rendering of the HTML markup in this segment into text.
public  TextExtractorgetTextExtractor()
     Extracts the textual content from the HTML markup of this segment.
public  inthashCode()
     Returns a hash code value for the segment.
public  voidignoreWhenParsing()
     Causes the this segment to be ignored when parsing.

Ignored segments are treated as blank spaces by the parsing mechanism, but are included as normal text in all other functions.

This method was originally the only means of preventing located inside tags from interfering with the parsing of the tags. The most common scenario is where the of a normal tag uses server tags to dynamically set the values of the attributes.

As of version 2.4 it is no longer necessary to use this method to ignore inside normal tags, as the attributes parser now automatically ignores common server tags.

As of version 2.5 it is also unnecessary to use this method to ignore the contents of HTMLElementName.SCRIPT SCRIPT elements, as the parser automatically ignores this content when performing a .

This leaves only a few scenarios where calling this method still provides a significant benefit.

One such case is where XML-style server tags are used inside tags. Here is an example using an XML-style JSP tag:

<a href="<i18n:resource path="/Portal"/>?BACK=TRUE">back</a>
The first double-quote of "/Portal" will be interpreted as the end quote for the href attribute, as there is no way for the parser to recognise the il8n:resource element as a server tag. Such use of XML-style server tags inside tags is generally seen as bad practice, but it is nevertheless valid JSP.
final public  booleanisWhiteSpace()
     Indicates whether this segment consists entirely of .
final public static  booleanisWhiteSpace(char ch)
     Indicates whether the specified character is white space.

The HTML 4.01 specification section 9.1 specifies the following white space characters:

  • space (U+0020)
  • tab (U+0009)
  • form feed (U+000C)
  • line feed (U+000A)
  • carriage return (U+000D)
  • zero-width space (U+200B)

Despite the explicit inclusion of the zero-width space in the HTML specification, Microsoft IE6 does not recognise them as whitespace and renders them as an unprintable character (empty square). Even zero-width spaces included using the numeric character reference &#x200B; are rendered this way.
Parameters:
  ch - the character to test.

final public  intlength()
     Returns the length of the segment.
public  AttributesparseAttributes()
     Parses any Attributes within this segment.
final public  CharSequencesubSequence(int beginIndex, int endIndex)
     Returns a new character sequence that is a subsequence of this sequence.

This is logically equivalent to toString().subSequence(beginIndex,endIndex) for valid values of beginIndex and endIndex.

However because this implementation works directly on the underlying document source string, it should not be assumed that an IndexOutOfBoundsException is thrown for invalid argument values as described in the String.subSequence(int,int) method.
Parameters:
  beginIndex - the begin index, inclusive.
Parameters:
  endIndex - the end index, exclusive.

public  StringtoString()
     Returns the source text of this segment as a String.

Field Detail
begin
final int begin(Code)



childElements
List childElements(Code)



end
final int end(Code)



source
final Source source(Code)




Constructor Detail
Segment
public Segment(Source source, int begin, int end)(Code)
Constructs a new Segment within the specified document with the specified begin and end character positions.
Parameters:
  source - the Source document, must not be null.
Parameters:
  begin - the character position in the source where this segment begins.
Parameters:
  end - the character position in the source where this segment ends.



Segment
Segment(int length)(Code)



Segment
Segment()(Code)




Method Detail
appendCollapseWhiteSpace
final static StringBuffer appendCollapseWhiteSpace(StringBuffer sb, CharSequence text)(Code)
Collapses the in the specified text. All leading and trailing white space is omitted, and any sections of internal white space are replaced by a single space.



charAt
final public char charAt(int index)(Code)
Returns the character at the specified index.

This is logically equivalent to toString().charAt(index) for valid argument values 0 <= index < length().

However because this implementation works directly on the underlying document source string, it should not be assumed that an IndexOutOfBoundsException is thrown for an invalid argument value.
Parameters:
  index - the index of the character. the character at the specified index.




compareTo
public int compareTo(Object o)(Code)
Compares this Segment object to another object.

If the argument is not a Segment, a ClassCastException is thrown.

A segment is considered to be before another segment if its begin position is earlier, or in the case that both segments begin at the same position, its end position is earlier.

Segments that begin and end at the same position are considered equal for the purposes of this comparison, even if they relate to different source documents.

Note: this class has a natural ordering that is inconsistent with equals. This means that this method may return zero in some cases where calling the Segment.equals(Object) method with the same argument returns false.
Parameters:
  o - the segment to be compared a negative integer, zero, or a positive integer as this segment is before, equal to, or after the specified segment.
throws:
  ClassCastException - if the argument is not a Segment




encloses
final public boolean encloses(Segment segment)(Code)
Indicates whether this Segment encloses the specified Segment.

This is the case if Segment.getBegin() <=segment. Segment.getBegin() && Segment.getEnd() >=segment. Segment.getEnd() .
Parameters:
  segment - the segment to be tested for being enclosed by this segment. true if this Segment encloses the specified Segment, otherwise false.




encloses
final public boolean encloses(int pos)(Code)
Indicates whether this segment encloses the specified character position in the source document.

This is the case if Segment.getBegin() <= pos < Segment.getEnd() .
Parameters:
  pos - the position in the Source document. true if this segment encloses the specified character position in the source document, otherwise false.




equals
final public boolean equals(Object object)(Code)
Compares the specified object with this Segment for equality.

Returns true if and only if the specified object is also a Segment, and both segments have the same Source , and the same begin and end positions.
Parameters:
  object - the object to be compared for equality with this Segment. true if the specified object is equal to this Segment, otherwise false.




extractText
public String extractText()(Code)
Extracts the textual content from the HTML markup of this segment.

This method has been deprecated as of version 2.4 and replaced with the Segment.getTextExtractor() method. the textual content from the HTML markup of this segment.Segment.getTextExtractor()TextExtractor.toString toString()




extractText
public String extractText(boolean includeAttributes)(Code)
Extracts the textual content from the HTML markup of this segment.

This method has been deprecated as of version 2.4 and replaced with the Segment.getTextExtractor() method.
Parameters:
  includeAttributes - specifies whether the values of title, alt, label, and summary attributes are included in the output. the textual content from the HTML markup of this segment.Segment.getTextExtractor()TextExtractor.setIncludeAttributes(boolean) setIncludeAttributes(includeAttributes)TextExtractor.toString toString()




findAllCharacterReferences
public List findAllCharacterReferences()(Code)
Returns a list of all CharacterReference objects that are by this segment. a list of all CharacterReference objects that are by this segment.



findAllElements
public List findAllElements()(Code)
Returns a list of all Element objects that are by this segment.

The Source.fullSequentialParse method should be called after construction of the Source object if this method is to be used on a large proportion of the source. It is called automatically if this method is called on the Source object itself.

The elements returned correspond exactly with the start tags returned in the Segment.findAllStartTags() method. a list of all Element objects that are by this segment.




findAllElements
public List findAllElements(String name)(Code)
Returns a list of all Element objects with the specified name that are by this segment.

The elements returned correspond exactly with the start tags returned in the Segment.findAllStartTags(String name) method.

Specifying a null argument to the name parameter is equivalent to Segment.findAllElements() .

This method also returns elements consisting of tags if the specified name is not a valid .
Parameters:
  name - the of the elements to find. a list of all Element objects with the specified name that are by this segment.




findAllElements
public List findAllElements(StartTagType startTagType)(Code)
Returns a list of all Element objects with start tags of the specified that are by this segment.

The elements returned correspond exactly with the start tags returned in the Segment.findAllTags(TagType) method.
Parameters:
  startTagType - the of start tags to find, must not be null. a list of all Element objects with start tags of the specified that are by this segment.




findAllElements
public List findAllElements(String attributeName, String value, boolean valueCaseSensitive)(Code)
Returns a list of all Element objects with the specified attribute name/value pair that are by this segment.

The elements returned correspond exactly with the start tags returned in the Segment.findAllStartTags(String attributeName,String value,boolean valueCaseSensitive) method.
Parameters:
  attributeName - the attribute name (case insensitive) to search for, must not be null.
Parameters:
  value - the value of the specified attribute to search for, must not be null.
Parameters:
  valueCaseSensitive - specifies whether the attribute value matching is case sensitive. a list of all Element objects with the specified attribute name/value pair that are by this segment.




findAllStartTags
public List findAllStartTags()(Code)
Returns a list of all StartTag objects that are by this segment.

The Source.fullSequentialParse method should be called after construction of the Source object if this method is to be used on a large proportion of the source. It is called automatically if this method is called on the Source object itself.

See the Tag class documentation for more details about the behaviour of this method. a list of all StartTag objects that are by this segment.




findAllStartTags
public List findAllStartTags(String name)(Code)
Returns a list of all StartTag objects with the specified name that are by this segment.

See the Tag class documentation for more details about the behaviour of this method.

Specifying a null argument to the name parameter is equivalent to Segment.findAllStartTags() .

This method also returns tags if the specified name is not a valid .
Parameters:
  name - the of the start tags to find. a list of all StartTag objects with the specified name that are by this segment.




findAllStartTags
public List findAllStartTags(String attributeName, String value, boolean valueCaseSensitive)(Code)
Returns a list of all StartTag objects with the specified attribute name/value pair that are by this segment.

See the Tag class documentation for more details about the behaviour of this method.
Parameters:
  attributeName - the attribute name (case insensitive) to search for, must not be null.
Parameters:
  value - the value of the specified attribute to search for, must not be null.
Parameters:
  valueCaseSensitive - specifies whether the attribute value matching is case sensitive. a list of all StartTag objects with the specified attribute name/value pair that are by this segment.




findAllTags
public List findAllTags()(Code)
Returns a list of all Tag objects that are by this segment.

The Source.fullSequentialParse method should be called after construction of the Source object if this method is to be used on a large proportion of the source. It is called automatically if this method is called on the Source object itself.

See the Tag class documentation for more details about the behaviour of this method. a list of all Tag objects that are by this segment.




findAllTags
public List findAllTags(TagType tagType)(Code)
Returns a list of all Tag objects of the specified that are by this segment.

See the Tag class documentation for more details about the behaviour of this method.

Specifying a null argument to the tagType parameter is equivalent to Segment.findAllTags() .
Parameters:
  tagType - the of tags to find. a list of all Tag objects of the specified that are by this segment.




findFormControls
public List findFormControls()(Code)
Returns a list of the FormControl objects that are by this segment. a list of the FormControl objects that are by this segment.



findFormFields
public FormFields findFormFields()(Code)
Returns the FormFields object representing all form fields that are by this segment.

This is equivalent to FormFields.FormFields(Collection) new FormFields ( Segment.findFormControls() ). the FormFields object representing all form fields that are by this segment.
See Also:   Segment.findFormControls()




getBegin
final public int getBegin()(Code)
Returns the character position in the Source document at which this segment begins. the character position in the Source document at which this segment begins.



getChildElements
public List getChildElements()(Code)
Returns a list of the immediate children of this segment in the document element hierarchy.

The returned list may include an element that extends beyond the end of this segment, as long as it begins within this segment.

An element found at the start of this segment is included in the list. Note however that if this segment is an Element , the overriding Element.getChildElements method is called instead, which only returns the children of the element.

Calling getChildElements() on an Element is usually more efficient than calling it on a Segment.

The objects in the list are all of type Element .

The Source.fullSequentialParse method should be called after construction of the Source object if this method is to be used on a large proportion of the source. It is called automatically if this method is called on the Source object itself.

See the Source.getChildElements method for more details. the a list of the immediate children of this segment in the document element hierarchy, guaranteed not null.
See Also:   Element.getParentElement




getDebugInfo
public String getDebugInfo()(Code)
Returns a string representation of this object useful for debugging purposes. a string representation of this object useful for debugging purposes.



getEnd
final public int getEnd()(Code)
Returns the character position in the Source document immediately after the end of this segment.

The character at the position specified by this property is not included in the segment. the character position in the Source document immediately after the end of this segment.




getRenderer
public Renderer getRenderer()(Code)
Performs a simple rendering of the HTML markup in this segment into text.

The output can be configured by setting any number of properties on the returned Renderer instance before . an instance of Renderer based on this segment.
See Also:   Segment.getTextExtractor()




getTextExtractor
public TextExtractor getTextExtractor()(Code)
Extracts the textual content from the HTML markup of this segment.

The output can be configured by setting properties on the returned TextExtractor instance before .

an instance of TextExtractor based on this segment.
See Also:   Segment.getRenderer()




hashCode
public int hashCode()(Code)
Returns a hash code value for the segment.

The current implementation returns the sum of the begin and end positions, although this is not guaranteed in future versions. a hash code value for the segment.




ignoreWhenParsing
public void ignoreWhenParsing()(Code)
Causes the this segment to be ignored when parsing.

Ignored segments are treated as blank spaces by the parsing mechanism, but are included as normal text in all other functions.

This method was originally the only means of preventing located inside tags from interfering with the parsing of the tags. The most common scenario is where the of a normal tag uses server tags to dynamically set the values of the attributes.

As of version 2.4 it is no longer necessary to use this method to ignore inside normal tags, as the attributes parser now automatically ignores common server tags.

As of version 2.5 it is also unnecessary to use this method to ignore the contents of HTMLElementName.SCRIPT SCRIPT elements, as the parser automatically ignores this content when performing a .

This leaves only a few scenarios where calling this method still provides a significant benefit.

One such case is where XML-style server tags are used inside tags. Here is an example using an XML-style JSP tag:

<a href="<i18n:resource path="/Portal"/>?BACK=TRUE">back</a>
The first double-quote of "/Portal" will be interpreted as the end quote for the href attribute, as there is no way for the parser to recognise the il8n:resource element as a server tag. Such use of XML-style server tags inside tags is generally seen as bad practice, but it is nevertheless valid JSP. The only way to ensure that this library is able to parse the normal tag surrounding it is to find these server tags first and call the ignoreWhenParsing method to ignore them before parsing the rest of the document.

It is important to understand the difference between ignoring the segment when parsing and removing the segment completely. Any text inside a segment that is ignored when parsing is treated by most functions as content, and as such is included in the output of tools such as TextExtractor and Renderer .

To remove segments completely, create an OutputDocument and call its OutputDocument.remove(Segment) remove(Segment) or OutputDocument.replaceWithSpaces(intint) replaceWithSpaces(int begin, int end) method for each segment. Then create a new source document using Source.Source(CharSequence) new Source(outputDocument.toString()) and perform the desired operations on this new source object.

Calling this method after the Source.fullSequentialParse method has been called is not permitted and throws an IllegalStateException.

Any tags appearing in this segment that are found before this method is called will remain in the , and so will continue to be found by the tag search methods. If this is undesirable, the Source.clearCache method can be called to remove them from the cache. Calling the Source.fullSequentialParse method after this method clears the cache automatically.

For best performance, this method should be called on all segments that need to be ignored without calling any of the tag search methods in between.
See Also:   Source.ignoreWhenParsing(Collection segments)




isWhiteSpace
final public boolean isWhiteSpace()(Code)
Indicates whether this segment consists entirely of . true if this segment consists entirely of , otherwise false.



isWhiteSpace
final public static boolean isWhiteSpace(char ch)(Code)
Indicates whether the specified character is white space.

The HTML 4.01 specification section 9.1 specifies the following white space characters:

  • space (U+0020)
  • tab (U+0009)
  • form feed (U+000C)
  • line feed (U+000A)
  • carriage return (U+000D)
  • zero-width space (U+200B)

Despite the explicit inclusion of the zero-width space in the HTML specification, Microsoft IE6 does not recognise them as whitespace and renders them as an unprintable character (empty square). Even zero-width spaces included using the numeric character reference &#x200B; are rendered this way.
Parameters:
  ch - the character to test. true if the specified character is white space, otherwise false.




length
final public int length()(Code)
Returns the length of the segment. This is defined as the number of characters between the begin and end positions. the length of the segment.



parseAttributes
public Attributes parseAttributes()(Code)
Parses any Attributes within this segment. This method is only used in the unusual situation where attributes exist outside of a start tag. The StartTag.getAttributes method should be used in normal situations.

This is equivalent to source. Source.parseAttributes(intint) parseAttributes ( Segment.getBegin() , Segment.getEnd() ). the Attributes within this segment, or null if too many errors occur while parsing.




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

This is logically equivalent to toString().subSequence(beginIndex,endIndex) for valid values of beginIndex and endIndex.

However because this implementation works directly on the underlying document source string, it should not be assumed that an IndexOutOfBoundsException is thrown for invalid argument values as described in the String.subSequence(int,int) method.
Parameters:
  beginIndex - the begin index, inclusive.
Parameters:
  endIndex - the end index, exclusive. a new character sequence that is a subsequence of this sequence.




toString
public String toString()(Code)
Returns the source text of this segment as a String.

The returned String is newly created with every call to this method, unless this segment is itself an instance of Source .

Note that before version 2.0 this returned a representation of this object useful for debugging purposes, which can now be obtained via the Segment.getDebugInfo() method. the source text of this segment 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.