ix.util
Class Parameters
java.lang.Object
|
+--ix.util.Parameters
- public abstract class Parameters
- extends java.lang.Object
The Parameters class contains methods that allow information from
application command-line arguments and from Applet parameters to
be used in a uniform way. The class cannot be instantiated.
- See Also:
Properties
,
java.lang.System
Method Summary |
static boolean |
allParametersWereUsed()
|
static void |
checkParameterUse()
|
static boolean |
getBoolean(java.lang.String pname)
|
static boolean |
getBoolean(java.lang.String pname,
boolean defaultValue)
|
static int |
getInt(java.lang.String pname)
|
static int |
getInt(java.lang.String pname,
int defaultValue)
|
static int |
getInt(java.lang.String pname,
int radix,
int defaultValue)
|
static java.util.List |
getList(java.lang.String pname)
|
static java.util.List |
getList(java.lang.String pname,
java.util.List defaultValue)
|
static java.lang.String |
getParameter(java.lang.String pname)
|
static java.lang.String |
getParameter(java.lang.String pname,
java.lang.String defaultValue)
|
static java.util.Properties |
getParameters()
|
static boolean |
haveParameter(java.lang.String pname)
|
static void |
loadParameters(java.lang.String filename)
|
static void |
processCommandLineArguments(java.lang.String[] argv)
Parse a String[] of command-line arguments. |
static void |
setParameter(java.lang.String pname,
java.lang.String value)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameters
public Parameters()
setParameter
public static void setParameter(java.lang.String pname,
java.lang.String value)
getParameters
public static java.util.Properties getParameters()
getParameter
public static java.lang.String getParameter(java.lang.String pname)
getParameter
public static java.lang.String getParameter(java.lang.String pname,
java.lang.String defaultValue)
haveParameter
public static boolean haveParameter(java.lang.String pname)
getInt
public static int getInt(java.lang.String pname)
getInt
public static int getInt(java.lang.String pname,
int defaultValue)
getInt
public static int getInt(java.lang.String pname,
int radix,
int defaultValue)
getBoolean
public static boolean getBoolean(java.lang.String pname)
getBoolean
public static boolean getBoolean(java.lang.String pname,
boolean defaultValue)
getList
public static java.util.List getList(java.lang.String pname)
getList
public static java.util.List getList(java.lang.String pname,
java.util.List defaultValue)
checkParameterUse
public static void checkParameterUse()
allParametersWereUsed
public static boolean allParametersWereUsed()
processCommandLineArguments
public static void processCommandLineArguments(java.lang.String[] argv)
- Parse a String[] of command-line arguments. The syntax of an
argument is -name=value. The value assigned to a name can the
be obtained as a String by calling getParameter("name"). Other
get-methods can return values of other types.
If no value is given, the value is the empty string "".
For getBoolean(name), this is equivalent to "true".
The syntax -not name, or -no name, is equivalent to -name=false.
The syntax -load filename can be used to read parameter values
from a file. The file should contain lines in name=value syntax.
loadParameters
public static void loadParameters(java.lang.String filename)