org.overlord.sramp.common.query.xpath
Class CharacterStream

java.lang.Object
  extended by org.overlord.sramp.common.query.xpath.CharacterStream

public class CharacterStream
extends Object

A stream of character data.

Author:
eric.wittmann@redhat.com

Constructor Summary
CharacterStream(String input)
          Constructor.
 
Method Summary
 boolean areNext(char... values)
          Returns true if the next N characters in the stream are equal to the sequence of characters provided.
 String get(int startIndex, int endIndex)
          Gets the token value represented by the given range.
 boolean hasNext()
          Returns true if there are more characters in the stream.
 int index()
          Returns the current index into the stream.
 boolean isNext(char... values)
          Returns true if the next character in the stream is equal to any of the given characters.
 boolean isNext(String values)
          Returns true if the next character in the stream is any of the characters included in the given string.
 boolean isNextNumeric()
          Returns true if the next character in the stream is a valid numeric character.
 boolean isNextNumericStart()
          Returns true if the next character in the stream is a valid start character for a numeric.
 boolean isNextValidXmlNcNameCharacter()
          Returns true if the next character in the stream is a valid XML NCName character.
 char next()
          Reads the next character in the stream and returns it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterStream

public CharacterStream(String input)
Constructor.

Parameters:
input -
Method Detail

hasNext

public boolean hasNext()
Returns true if there are more characters in the stream.


next

public char next()
Reads the next character in the stream and returns it.


isNext

public boolean isNext(String values)
Returns true if the next character in the stream is any of the characters included in the given string.

Parameters:
values -

isNext

public boolean isNext(char... values)
Returns true if the next character in the stream is equal to any of the given characters.

Parameters:
values -

isNextNumericStart

public boolean isNextNumericStart()
Returns true if the next character in the stream is a valid start character for a numeric.


isNextNumeric

public boolean isNextNumeric()
Returns true if the next character in the stream is a valid numeric character.


isNextValidXmlNcNameCharacter

public boolean isNextValidXmlNcNameCharacter()
Returns true if the next character in the stream is a valid XML NCName character.


areNext

public boolean areNext(char... values)
Returns true if the next N characters in the stream are equal to the sequence of characters provided.

Parameters:
values -

index

public int index()
Returns the current index into the stream.


get

public String get(int startIndex,
                  int endIndex)
Gets the token value represented by the given range.

Parameters:
startIndex -
endIndex -


Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.