|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.io.ParameterSetParser
public class ParameterSetParser
This class extracts values from Parameter
s and creates instances of
InstantiableFromParameterSet
s 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.INT
DataType
,
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.FLOAT
DataType
,
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.DOUBLE
DataType
,
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.SHORT
DataType
,
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.LONG
DataType
,
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.BYTE
DataType
,
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.BOOLEAN
DataType
,
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.STRING
DataType
,
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 InstanceParameterSet
pars
- the InstanceParameterSet
ParameterSetParser.NotInstantiableException
- if InstanceParameterSet.getInstanceClass()
of
pars
is null
, could not be found or
cannot be instantiated from pars
InstanceParameterSet.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 InstanceParameterSet
pars
- the ParameterSet
instanceClass
- 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 All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |