org.jscience.io
Class ArgumentParser

java.lang.Object
  extended by org.jscience.io.ArgumentParser
All Implemented Interfaces:
java.io.Serializable

public class ArgumentParser
extends java.lang.Object
implements java.io.Serializable

ArgumentParser is a helper class that parses arguments in results according to CDDB Protocol level 2. It works similarly to a StringTokenizer, but it properly handles arguments enclosed with quotes, i.e. delimiters are not recognized if the occurence is within a quoted section.

See Also:
Serialized Form

Field Summary
protected  java.lang.String delimiter
          protected to allow custom delimiters for subclasses
 
Constructor Summary
ArgumentParser(java.lang.String line)
          Creates a new ArgumentParser object.
ArgumentParser(java.lang.String line, int startingPosition)
          Creates a new ArgumentParser object.
ArgumentParser(java.lang.String line, java.lang.String delimiter)
          Creates a new ArgumentParser object.
 
Method Summary
static java.lang.String[] getAll(java.lang.String line)
          DOCUMENT ME!
static java.lang.String[] getAll(java.lang.String line, java.lang.String delimiter)
          DOCUMENT ME!
 boolean hasMoreArguments()
          DOCUMENT ME!
 java.lang.String nextArgument()
          DOCUMENT ME!
 java.lang.String remainder()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delimiter

protected java.lang.String delimiter
protected to allow custom delimiters for subclasses

Constructor Detail

ArgumentParser

public ArgumentParser(java.lang.String line)
Creates a new ArgumentParser object.

Parameters:
line - DOCUMENT ME!

ArgumentParser

public ArgumentParser(java.lang.String line,
                      java.lang.String delimiter)
Creates a new ArgumentParser object.

Parameters:
line - DOCUMENT ME!
delimiter - DOCUMENT ME!

ArgumentParser

public ArgumentParser(java.lang.String line,
                      int startingPosition)
Creates a new ArgumentParser object.

Parameters:
line - DOCUMENT ME!
startingPosition - DOCUMENT ME!
Method Detail

remainder

public java.lang.String remainder()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getAll

public static java.lang.String[] getAll(java.lang.String line)
DOCUMENT ME!

Parameters:
line - DOCUMENT ME!
Returns:
DOCUMENT ME!

getAll

public static java.lang.String[] getAll(java.lang.String line,
                                        java.lang.String delimiter)
DOCUMENT ME!

Parameters:
line - DOCUMENT ME!
delimiter - DOCUMENT ME!
Returns:
DOCUMENT ME!

hasMoreArguments

public boolean hasMoreArguments()
DOCUMENT ME!

Returns:
DOCUMENT ME!

nextArgument

public java.lang.String nextArgument()
                              throws java.util.NoSuchElementException
DOCUMENT ME!

Returns:
DOCUMENT ME!
Throws:
java.util.NoSuchElementException - DOCUMENT ME!