|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OutputSegment
Defines the interface for an output segment, which is used in an OutputDocument
to
replace segments of the source document with other text.
All text in the OutputDocument
between the character positions defined by getBegin()
and getEnd()
is replaced by the content of this output segment.
If the begin and end character positions are the same, the content is simply
inserted at this position without replacing any text.
OutputDocument.register(OutputSegment)
Field Summary | |
---|---|
static Comparator<OutputSegment> |
COMPARATOR
The comparator used to sort output segments in the OutputDocument before output. |
Method Summary | |
---|---|
void |
appendTo(Appendable appendable)
Appends the content of this output segment to the specified Appendable object. |
int |
getBegin()
Returns the character position in the source text of the output document where this segment begins. |
String |
getDebugInfo()
Returns a string representation of this object useful for debugging purposes. |
int |
getEnd()
Returns the character position in the source text of the output document where this segment ends. |
String |
toString()
Returns the content of this output segment as a String . |
void |
writeTo(Writer writer)
Writes the content of this output segment to the specified Writer . |
Methods inherited from interface net.htmlparser.jericho.CharStreamSource |
---|
getEstimatedMaximumOutputLength |
Field Detail |
---|
static final Comparator<OutputSegment> COMPARATOR
OutputDocument
before output.
The following rules are applied in order compare two output segments:
Note: this comparator has a natural ordering that may be inconsistent with the equals
method of classes implementing this interface.
This means that the comparator may treat two output segments as equal where calling the
equals(Object)
method with the same two output segments returns false
.
Method Detail |
---|
int getBegin()
int getEnd()
void writeTo(Writer writer) throws IOException
Writer
.
writeTo
in interface CharStreamSource
writer
- the destination java.io.Writer
for the output.
IOException
- if an I/O exception occurs.void appendTo(Appendable appendable) throws IOException
Appendable
object.
appendTo
in interface CharStreamSource
appendable
- the destination java.lang.Appendable
object for the output.
IOException
- if an I/O exception occurs.String toString()
String
.
toString
in interface CharStreamSource
toString
in class Object
String
, guaranteed not null
.writeTo(Writer)
String getDebugInfo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |