au.id.jericho.lib.html

Class StringOutputSegment

Implemented Interfaces:
CharStreamSource, OutputSegment

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

Implements an OutputSegment whose content is a CharSequence.

This class has been deprecated as of version 2.2 and the functionality replaced with the OutputDocument.replace(Segment, CharSequence text) method.

Fields inherited from interface au.id.jericho.lib.html.OutputSegment

COMPARATOR

Constructor Summary

StringOutputSegment(Segment segment, CharSequence text)
Constructs a new StringOutputSegment with the same span as the specified Segment.
StringOutputSegment(int begin, int end, CharSequence text)
Constructs a new StringOutputSegment with the specified begin and end positions and the specified content.

Method Summary

int
getBegin()
String
getDebugInfo()
int
getEnd()
long
getEstimatedMaximumOutputLength()
void
output(Writer writer)
String
toString()
void
writeTo(Writer writer)

Constructor Details

StringOutputSegment

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

Specifying a null argument to the text parameter is exactly equivalent to specifying an empty string, and results in the segment being completely removed from the output document.

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.

StringOutputSegment

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

Specifying a null argument to the text parameter is exactly equivalent to specifying an empty string, and results in the segment being completely removed from the output document.

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.

Method Details

getBegin

public int getBegin()
Specified by:
getBegin in interface OutputSegment

getDebugInfo

public String getDebugInfo()
Specified by:
getDebugInfo in interface OutputSegment

getEnd

public int getEnd()
Specified by:
getEnd in interface OutputSegment

getEstimatedMaximumOutputLength

public long getEstimatedMaximumOutputLength()
Specified by:
getEstimatedMaximumOutputLength in interface CharStreamSource

output

public void output(Writer writer)
            throws IOException

toString

public String toString()
Specified by:
toString in interface OutputSegment

writeTo

public void writeTo(Writer writer)
            throws IOException
Specified by:
writeTo in interface OutputSegment
writeTo in interface CharStreamSource