All Downloads are FREE. Search and download functionalities are using the official Maven repository.

doc.api.au.id.jericho.lib.html.StringOutputSegment.html Maven / Gradle / Ivy

Go to download

Jericho HTML Parser is a simple but powerful java library allowing analysis and manipulation of parts of an HTML document, including some common server-side tags, while reproducing verbatim any unrecognised or invalid HTML. It also provides high-level HTML form manipulation functions.

There is a newer version: 2.3
Show newest version






StringOutputSegment (Jericho HTML Parser 1.5-dev1)

















au.id.jericho.lib.html
Class StringOutputSegment

java.lang.Object
  extended byau.id.jericho.lib.html.StringOutputSegment
All Implemented Interfaces:
IOutputSegment

public final class StringOutputSegment
extends java.lang.Object
implements IOutputSegment

Implements an IOutputSegment whose content is a CharSequence.


Field Summary
 
Fields inherited from interface au.id.jericho.lib.html.IOutputSegment
COMPARATOR
 
Constructor Summary
StringOutputSegment(int begin, int end, java.lang.CharSequence text)
          Constructs a new StringOutputSegment with the specified begin and end positions and the specified content.
StringOutputSegment(Segment segment, java.lang.CharSequence text)
          Constructs a new StringOutputSegment with the same span as the specified Segment.
 
Method Summary
 int getBegin()
          Returns the character position in the OutputDocument where this segment begins.
 java.lang.String getDebugInfo()
          Returns a string representation of this object useful for debugging purposes.
 int getEnd()
          Returns the character position in the OutputDocument where this segment ends.
 void output(java.io.Writer writer)
          Outputs the content of this output segment to the specified Writer.
 java.lang.String toString()
          Returns the content of this output segment as a String.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringOutputSegment

public StringOutputSegment(int begin,
                           int end,
                           java.lang.CharSequence text)
Constructs a new StringOutputSegment with the specified begin and end positions and the specified content.

Parameters:
begin - the position in the OutputDocument where this output segment begins.
end - the position in the OutputDocument where this output segment ends.
text - the textual content of the new output segment, or null if no content.

StringOutputSegment

public StringOutputSegment(Segment segment,
                           java.lang.CharSequence text)
Constructs a new StringOutputSegment with the same span as the specified Segment.

Parameters:
segment - a segment defining the beginning and ending positions of the new output segment.
text - the textual content of the new output segment, or null if no content.
Method Detail

getBegin

public int getBegin()
Description copied from interface: IOutputSegment
Returns the character position in the OutputDocument where this segment begins.

Specified by:
getBegin in interface IOutputSegment
Returns:
the character position in the OutputDocument where this segment begins.

getEnd

public int getEnd()
Description copied from interface: IOutputSegment
Returns the character position in the OutputDocument where this segment ends.

Specified by:
getEnd in interface IOutputSegment
Returns:
the character position in the OutputDocument where this segment ends.

output

public void output(java.io.Writer writer)
            throws java.io.IOException
Description copied from interface: IOutputSegment
Outputs the content of this output segment to the specified Writer.

Specified by:
output in interface IOutputSegment
Parameters:
writer - the Writer to which the output is to be sent.
Throws:
java.io.IOException - if an I/O exception occurs.

toString

public java.lang.String toString()
Description copied from interface: IOutputSegment
Returns the content of this output segment as a String.

Note that before version 1.5 this returned a representation of this object useful for debugging purposes, which can now be obtained via the getDebugInfo() method.

Specified by:
toString in interface IOutputSegment

getDebugInfo

public java.lang.String getDebugInfo()
Description copied from interface: IOutputSegment
Returns a string representation of this object useful for debugging purposes.

Specified by:
getDebugInfo in interface IOutputSegment
Returns:
a string representation of this object useful for debugging purposes.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy