Java Reference
In-Depth Information
{
charMap = new HashMap<String, Character>();
charMap.put("nbsp", ' ');
charMap.put("lt", '<');
charMap.put("gt", '>');
charMap.put("amp", '&');
charMap.put("quot", '\"');
charMap.put("bull", (char) 149);
charMap.put("trade", (char) 129);
}
}
/**
* Return the last tag found, this is normally called just
* after the read function returns a zero.
*
* @return The last HTML tag found.
*/
public HTMLTag getTag()
{
return this.tag;
}
/**
* Read a single character from the HTML source, if this
* function returns zero(0) then you should call getTag to
* see what tag was found. Otherwise the value returned is
* simply the next character found.
*
* @return The character read, or zero if there is an HTML
* tag. If zero is returned, then call getTag to
* get the next tag.
*
* @throws IOException
* If an error occurs while reading.
*/
public int read() throws IOException
{
// handle locked end tag
if (this.lockedEndTag != null)
{
if (peekEndTag(this.lockedEndTag))
{
this.lockedEndTag = null;
} else
{
Search WWH ::




Custom Search