au.id.jericho.lib.html
Class StringOutputSegment

java.lang.Object
  extended byStringOutputSegment
All Implemented Interfaces:
CharStreamSource, OutputSegment

Deprecated. Use the OutputDocument.replace(Segment, CharSequence text) method instead.

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.


Field Summary
 
Fields inherited from interface OutputSegment
COMPARATOR
 
Constructor Summary
StringOutputSegment(int begin, int end, java.lang.CharSequence text)
          Deprecated. Constructs a new StringOutputSegment with the specified begin and end positions and the specified content.
StringOutputSegment(Segment segment, java.lang.CharSequence text)
          Deprecated. Constructs a new StringOutputSegment with the same span as the specified Segment.
 
Method Summary
 int getBegin()
          Deprecated. Returns the character position in the source text of the output document where this segment begins.
 java.lang.String getDebugInfo()
          Deprecated. Returns a string representation of this object useful for debugging purposes.
 int getEnd()
          Deprecated. Returns the character position in the source text of the output document where this segment ends.
 long getEstimatedMaximumOutputLength()
          Deprecated. Returns the estimated maximum number of characters in the output, or -1 if no estimate is available.
 void output(java.io.Writer writer)
          Deprecated.  
 java.lang.String toString()
          Deprecated. Returns the content of this output segment as a String.
 void writeTo(java.io.Writer writer)
          Deprecated. Writes the content of this output segment to the specified Writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringOutputSegment

public StringOutputSegment(int begin,
                           int end,
                           java.lang.CharSequence text)
Deprecated. 
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.

StringOutputSegment

public StringOutputSegment(Segment segment,
                           java.lang.CharSequence text)
Deprecated. 
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.
Method Detail

getBegin

public int getBegin()
Deprecated. 
Description copied from interface: OutputSegment
Returns the character position in the source text of the output document where this segment begins.

Specified by:
getBegin in interface OutputSegment
Returns:
the character position in the source text of the output document where this segment begins.

getEnd

public int getEnd()
Deprecated. 
Description copied from interface: OutputSegment
Returns the character position in the source text of the output document where this segment ends.

Specified by:
getEnd in interface OutputSegment
Returns:
the character position in the source text of the output document where this segment ends.

writeTo

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

Specified by:
writeTo in interface OutputSegment
Parameters:
writer - the destination java.io.Writer for the output.
Throws:
java.io.IOException - if an I/O exception occurs.

getEstimatedMaximumOutputLength

public long getEstimatedMaximumOutputLength()
Deprecated. 
Description copied from interface: CharStreamSource
Returns the estimated maximum number of characters in the output, or -1 if no estimate is available.

The returned value should be used as a guide for efficiency purposes only, for example to set an initial StringBuffer capacity. There is no guarantee that the length of the output is indeed less than this value, as classes implementing this method often use assumptions based on typical usage to calculate the estimate.

Specified by:
getEstimatedMaximumOutputLength in interface CharStreamSource
Returns:
the estimated maximum number of characters in the output, or -1 if no estimate is available.

toString

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

Note that before version 2.0 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 OutputSegment

getDebugInfo

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

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

output

public void output(java.io.Writer writer)
            throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException