public abstract class AbstractNode extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected int |
nodeBegin
The beginning position of the tag in the line
|
protected int |
nodeEnd
The ending position of the tag in the line
|
| Constructor and Description |
|---|
AbstractNode(int start,
int end)
Create an abstract node with the page positions given.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Clone this object.
|
int |
getEndPosition()
Gets the ending position of the node.
|
int |
getStartPosition()
Gets the starting position of the node.
|
String |
getText()
Returns the text of the node.
|
void |
setEndPosition(int position)
Sets the ending position of the node.
|
void |
setStartPosition(int position)
Sets the starting position of the node.
|
void |
setText(String text)
Sets the string contents of the node.
|
String |
toHtml()
Return the HTML for this node.
|
abstract String |
toHtml(boolean verbatim)
Return the HTML for this node.
|
abstract String |
toPlainTextString()
Returns a string representation of the node.
|
protected int nodeBegin
protected int nodeEnd
public AbstractNode(int start,
int end)
start - The starting offset of this node within the page.end - The ending offset of this node within the page.public Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic abstract String toPlainTextString()
Node node;
for (Enumeration e = parser.elements(); e.hasMoreElements();) {
node = (Node) e.nextElement();
System.out.println(node.toPlainTextString());
// or do whatever processing you wish with the plain text string
}
public String toHtml()
public abstract String toHtml(boolean verbatim)
verbatim - If true return as close to the original page
text as possible.public int getStartPosition()
public void setStartPosition(int position)
position - The new start position.public int getEndPosition()
public void setEndPosition(int position)
position - The new end position.public String getText()
null.public void setText(String text)
text - The new text for the node.Copyright © 2017 Java Wikipedia API (Bliki engine). All rights reserved.