|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.io.ParameterSetParser
public class ParameterSetParser
This class extracts values from Parameters and creates instances of
InstantiableFromParameterSets from a ParameterSet.
| Nested Class Summary | |
|---|---|
static class |
ParameterSetParser.NotInstantiableException
An Exception that is thrown if an instance of some class could
not be created. |
static class |
ParameterSetParser.WrongParameterTypeException
An Exception that is thrown if the DataType of a
Parameter is not appropriate for some purpose. |
| Constructor Summary | |
|---|---|
ParameterSetParser()
|
|
| Method Summary | ||
|---|---|---|
static boolean |
getBooleanFromParameter(Parameter par)
Returns the boolean which is the value of the
Parameter par. |
|
static byte |
getByteFromParameter(Parameter par)
Returns the byte which is the value of the Parameter
par. |
|
static double |
getDoubleFromParameter(Parameter par)
Returns the double which is the value of the
Parameter par. |
|
static float |
getFloatFromParameter(Parameter par)
Returns the float which is the value of the
Parameter par. |
|
static
|
getInstanceFromParameterSet(InstanceParameterSet<T> pars)
Returns an instance of a subclass of InstantiableFromParameterSet
that can be instantiated by the InstanceParameterSet
pars. |
|
static
|
getInstanceFromParameterSet(ParameterSet pars,
Class<T> instanceClass)
Returns an instance of a subclass of InstantiableFromParameterSet
that can be instantiated by the ParameterSet pars. |
|
static int |
getIntFromParameter(Parameter par)
Returns the int which is the value of the Parameter
par. |
|
static long |
getLongFromParameter(Parameter par)
Returns the long which is the value of the Parameter
par. |
|
static short |
getShortFromParameter(Parameter par)
Returns the short which is the value of the
Parameter par. |
|
static String |
getStringFromParameter(Parameter par)
Returns the String which is the value of the Parameter
par. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParameterSetParser()
| Method Detail |
|---|
public static int getIntFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
int which is the value of the Parameter
par.
par - the Parameter
int value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
int, i.e. its DataType is not
DataType.INTDataType,
DataType.INT
public static float getFloatFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
float which is the value of the
Parameter par.
par - the Parameter
float value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
float, i.e. its DataType is not
DataType.FLOATDataType,
DataType.FLOAT
public static double getDoubleFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
double which is the value of the
Parameter par.
par - the Parameter
double value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
double, i.e. its DataType is not
DataType.DOUBLEDataType,
DataType.DOUBLE
public static short getShortFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
short which is the value of the
Parameter par.
par - the Parameter
short value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
short, i.e. its DataType is not
DataType.SHORTDataType,
DataType.SHORT
public static long getLongFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
long which is the value of the Parameter
par.
par - the Parameter
long value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
long, i.e. its DataType is not
DataType.LONGDataType,
DataType.LONG
public static byte getByteFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
byte which is the value of the Parameter
par.
par - the Parameter
byte value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
byte, i.e. its DataType is not
DataType.BYTEDataType,
DataType.BYTE
public static boolean getBooleanFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
boolean which is the value of the
Parameter par.
par - the Parameter
boolean value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
boolean, i.e. its DataType is not
DataType.BOOLEANDataType,
DataType.BOOLEAN
public static String getStringFromParameter(Parameter par)
throws ParameterSetParser.WrongParameterTypeException
String which is the value of the Parameter
par.
par - the Parameter
String value of the Parameter
ParameterSetParser.WrongParameterTypeException - if par is not a Parameter of type
String, i.e. its DataType is not
DataType.STRINGDataType,
DataType.STRING
public static <T extends InstantiableFromParameterSet> T getInstanceFromParameterSet(InstanceParameterSet<T> pars)
throws ParameterSetParser.NotInstantiableException
InstantiableFromParameterSet
that can be instantiated by the InstanceParameterSet
pars. The instance class is taken from pars via
the method InstanceParameterSet.getInstanceClass().
T - the type of the InstanceParameterSetpars - the InstanceParameterSet
ParameterSetParser.NotInstantiableException - if InstanceParameterSet.getInstanceClass() of
pars is null, could not be found or
cannot be instantiated from parsInstanceParameterSet.getInstanceClass(),
getInstanceFromParameterSet(ParameterSet, Class)
public static <T extends InstantiableFromParameterSet> T getInstanceFromParameterSet(ParameterSet pars,
Class<T> instanceClass)
throws ParameterSetParser.NotInstantiableException
InstantiableFromParameterSet
that can be instantiated by the ParameterSet pars.
The instance class is taken from instanceClass.
T - the type of the InstanceParameterSetpars - the ParameterSetinstanceClass - the class that shall be instantiated
ParameterSetParser.NotInstantiableException - if instanceClass is null, could not
be found or cannot be instantiated from pars
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||