doc.api.au.id.jericho.lib.html.CharOutputSegment.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.
CharOutputSegment (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 CharOutputSegment
java.lang.Object
au.id.jericho.lib.html.CharOutputSegment
- All Implemented Interfaces:
- IOutputSegment
- public final class CharOutputSegment
- extends java.lang.Object
- implements IOutputSegment
Implements an IOutputSegment
whose content is a character constant.
Field Summary
Fields inherited from interface au.id.jericho.lib.html.IOutputSegment
COMPARATOR
Constructor Summary
CharOutputSegment(CharacterReference characterReference)
Constructs a new CharOutputSegment
which converts the specified CharacterReference
to a normal character.
CharOutputSegment(int begin,
int end,
char ch)
Constructs a new CharOutputSegment
with the specified begin and end character positions and the specified content.
CharOutputSegment(Segment segment,
char ch)
Constructs a new CharOutputSegment
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
CharOutputSegment
public CharOutputSegment(int begin,
int end,
char ch)
- Constructs a new
CharOutputSegment
with the specified begin and end character positions and the specified content.
- Parameters:
begin
- the position in the OutputDocument
where this OutputSegment
begins.end
- the position in the OutputDocument
where this OutputSegment
ends.ch
- the character output of the new OutputSegment
.
CharOutputSegment
public CharOutputSegment(Segment segment,
char ch)
- Constructs a new
CharOutputSegment
with the same span as the specified Segment
.
- Parameters:
segment
- a Segment
defining the begin and end character positions of the new OutputSegment
.ch
- the character output of the new OutputSegment
.
CharOutputSegment
public CharOutputSegment(CharacterReference characterReference)
- Constructs a new
CharOutputSegment
which converts the specified CharacterReference
to a normal character.
- Parameters:
characterReference
- the character reference to convert.
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.
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD