|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.erowid.sperowider.htmlshredding.RawHtmlData
Convenience class to allow easy parsing of found data. It sort of implements BufferedInputStream, but has a smarter marking mechanism ... you can make multiple nested marks. It is not threadsafe, so you'll have to manage that externally.
Field Summary | |
static char[] |
EMPTY_ARRAY
An empty character array |
Constructor Summary | |
RawHtmlData(InputStream in)
Creates a new RawHtmlData object from the InputStream |
|
RawHtmlData(Reader reader)
Creates a new RawHtmlData object from the Reader |
|
RawHtmlData(String data)
Creates a new RawHtmlData object from a String |
Method Summary | |
boolean |
characterMatch(int position,
char match)
Returns true if the character at the position matches the passed in character. |
boolean |
characterMatch(int position,
char match,
boolean ignoreCase)
Returns true if the character at the position matches the passed in character. |
boolean |
charactersMatch(int position,
char[] match)
Returns true if the characters starting at position match the passed in parameter, without adjusting the current position. |
boolean |
charactersMatch(int position,
char[] match,
boolean ignoreCase)
Returns true if the characters starting at position match the passed in parameter, without adjusting the current position. |
int |
getPosition()
Gets the current position |
boolean |
isAtEnd()
Returns true if the read position is past the end of the data |
void |
jumpTo(int position)
Jumps to a position |
static void |
main(String[] args)
Tests. |
boolean |
nextCharactersMatch(char[] match)
Returns true if the next characters match the passed in parameter, without adjusting the current position. |
boolean |
nextCharactersMatch(char[] match,
boolean ignoreCase)
Returns true if the next characters match the passed in parameter, without adjusting the current position. |
int |
read()
Returns the next character as an int, or -1 if there are no characters left to read. |
char[] |
read(int length)
Returns from the current position to the length provided |
char[] |
readPast(char[] match,
boolean include)
Reads up to, and including, the match characters |
char[] |
readPast(char[] match,
boolean include,
boolean ignoreCase)
Reads up to, and including, the match characters |
char[] |
readPast(char match,
boolean include)
Reads up to, and including, the match character |
char[] |
readPast(char match,
boolean include,
boolean ignoreCase)
Reads up to, and including, the match character |
char |
readPastWhitespace()
Returns the first non-whitespace character |
char[] |
readTo(int position)
Returns from the current position to the position provided |
char[] |
readUntil(char match)
Reads up to, but not including the match character |
char[] |
readUntil(char[] match)
Reads up to, but not including the match characters |
char[] |
readUntil(char[] match,
boolean ignoreCase)
Reads up to, but not including the match characters |
char[] |
readUntil(char match,
boolean ignoreCase)
Reads up to, but not including the match character |
char[] |
readWhitespace()
Reads until we're done with whitespace |
void |
skip(int offset)
Skips forward or back a number of spaces, and returns the position it's at. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char[] EMPTY_ARRAY
Constructor Detail |
public RawHtmlData(Reader reader) throws IOException
public RawHtmlData(InputStream in) throws IOException
public RawHtmlData(String data)
Method Detail |
public int getPosition()
public boolean isAtEnd()
public void jumpTo(int position)
IndexOutOfBoundsException
- If the jump-to position is below zero or
above the sizepublic void skip(int offset)
IndexOutOfBoundsException
- If the skipped-to position is below zero or
above the sizepublic int read()
public boolean nextCharactersMatch(char[] match, boolean ignoreCase)
public boolean nextCharactersMatch(char[] match)
public boolean characterMatch(int position, char match)
public boolean characterMatch(int position, char match, boolean ignoreCase)
public boolean charactersMatch(int position, char[] match, boolean ignoreCase)
public boolean charactersMatch(int position, char[] match)
public char[] read(int length)
public char[] readTo(int position)
public char[] readUntil(char match, boolean ignoreCase)
public char[] readUntil(char match)
public char[] readUntil(char[] match, boolean ignoreCase)
public char[] readUntil(char[] match)
public char[] readPast(char match, boolean include, boolean ignoreCase)
public char[] readPast(char match, boolean include)
public char[] readPast(char[] match, boolean include, boolean ignoreCase)
public char[] readPast(char[] match, boolean include)
public char[] readWhitespace()
public char readPastWhitespace()
public static void main(String[] args)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |