org.basex.util
Class Args

java.lang.Object
  extended by org.basex.util.Args

public final class Args
extends java.lang.Object

This class parses command-line arguments.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Constructor Summary
Args(java.lang.String[] a, java.lang.Object o, java.lang.String u, java.lang.String h)
          Default constructor.
 
Method Summary
 boolean dash()
          Checks if the current argument starts with a dash (i.e., introduces any flags).
 boolean more()
          Checks if more arguments are available.
 char next()
          Returns the next flag.
 int number()
          Returns the next positive numeric argument.
 java.lang.String string()
          Returns the next string argument.
 java.lang.String toString()
           
 void usage()
          Throws an exception with the command usage info.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Args

public Args(java.lang.String[] a,
            java.lang.Object o,
            java.lang.String u,
            java.lang.String h)
Default constructor.

Parameters:
a - arguments
o - calling object
u - usage info
h - header
Method Detail

more

public boolean more()
Checks if more arguments are available.

Returns:
result of check

dash

public boolean dash()
Checks if the current argument starts with a dash (i.e., introduces any flags).

Returns:
result of check

next

public char next()
Returns the next flag.

Returns:
next flag

string

public java.lang.String string()
Returns the next string argument.

Returns:
string

number

public int number()
           throws BaseXException
Returns the next positive numeric argument.

Returns:
positive integer
Throws:
BaseXException - database exception

usage

public void usage()
           throws BaseXException
Throws an exception with the command usage info.

Throws:
BaseXException - database exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object