ca.umontreal.iro.rali
Class XPathTokenizer

java.lang.Object
  extended by ca.umontreal.iro.rali.XPathTokenizer

public class XPathTokenizer
extends java.lang.Object

Specialized StreamTokeniser to simplify parsing of an XPath expression to be split in parts


Method Summary
 java.lang.String getToken()
          Return the current token
 boolean hasNext()
          Check if there are any token left
 boolean isString()
          Check if current token is a string
static void main(java.lang.String[] args)
          Some unit testing of this class
 java.lang.String nextToken()
          Get a new token and return it as a String
 java.lang.String skip(java.lang.String sym)
          Check if the current token is @sym and return the next one if this is not the case then raise an exception
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()
Check if there are any token left

Returns:
true if there any token to be read

isString

public boolean isString()
Check if current token is a string

Returns:
true if the current token is a string

nextToken

public java.lang.String nextToken()
                           throws java.io.IOException
Get a new token and return it as a String

Returns:
the string version of the new token
Throws:
java.io.IOException

getToken

public java.lang.String getToken()
Return the current token

Returns:
string version of the current token

skip

public java.lang.String skip(java.lang.String sym)
                      throws java.io.IOException
Check if the current token is @sym and return the next one if this is not the case then raise an exception

Parameters:
sym - the token to check with
Returns:
the value of the next token
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
Some unit testing of this class

Parameters:
args -