jd.util
Class Arguments

java.lang.Object
  extended byjd.util.Arguments

public class Arguments
extends Object

An iterator for command line arguments.


Constructor Summary
Arguments(String[] args)
          Create a CommandLineIterator.
 
Method Summary
 boolean hasMore()
          Test if there are more strings to come.
 boolean hasMore(int amount)
          Test if there are more strings to come.
 boolean match(String s)
          Return if the next argument matches the string.
 String next()
          Return the next string or null if there are no more arguments left.
 String next(String error)
          Return the next string or throw an BadArgException if there areno more arguments left.
 boolean startsWith(String s)
          Return if the next argument starts with the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Arguments

public Arguments(String[] args)
          throws BadArgException
Create a CommandLineIterator.

Parameters:
args - the arguments
Method Detail

next

public String next()
Return the next string or null if there are no more arguments left.


next

public String next(String error)
            throws BadArgException
Return the next string or throw an BadArgException if there areno more arguments left.

Throws:
BadArgException

match

public boolean match(String s)
Return if the next argument matches the string. If thats the case the string is consumed.


startsWith

public boolean startsWith(String s)
Return if the next argument starts with the given string.


hasMore

public boolean hasMore()
Test if there are more strings to come.


hasMore

public boolean hasMore(int amount)
Test if there are more strings to come.