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.
with the same span as the specified
StringOutputSegment (Jericho HTML Parser 1.5-dev1)
Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
au.id.jericho.lib.html
Class StringOutputSegmentjava.lang.Object au.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 aCharSequence
.
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 newStringOutputSegment
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 specifiedSegment
.
Method Summary int
getBegin()
Returns the character position in theOutputDocument
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 theOutputDocument
where this segment ends.void
output(java.io.Writer writer)
Outputs the content of this output segment to the specifiedWriter
.java.lang.String
toString()
Returns the content of this output segment as aString
.
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 theOutputDocument
where this output segment begins.end
- the position in theOutputDocument
where this output segment ends.text
- the textual content of the new output segment, ornull
if no content.
StringOutputSegment
public StringOutputSegment(Segment segment, java.lang.CharSequence text)
- Constructs a new StringOutputSegment
Segment
.
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 interfaceIOutputSegment
- 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 interfaceIOutputSegment
- 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 interfaceIOutputSegment
- Parameters:
writer
- theWriter
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 interfaceIOutputSegment
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 interfaceIOutputSegment
- Returns:
- a string representation of this object useful for debugging purposes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |