|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.debellor.core.Parameters
public class Parameters
Stores parameters that can be passed to a Cell
object.
Preserves their ordering.
Important: parameters should be accessed rarely during execution of a data processing algorithm, because this access may be slow. If you implement a parameterized algorithm, you should preferably read all parameters at the beginning of your algorithm and store them in your custom structures or variables for fast access.
Cell
,
Serialized FormNested Class Summary | |
---|---|
static class |
Parameters.Entry
|
Constructor Summary | |
---|---|
Parameters()
|
Method Summary | |
---|---|
void |
clear()
Clears the content of this Parameters instance, so that no parameters are defined afterwards. |
Parameters |
copy()
Returns deep copy of this object |
boolean |
exists(java.lang.String name)
Checks whether a given parameter is present. |
java.lang.String |
get(java.lang.String name)
Returns value of the parameter. |
boolean |
getAsBool(java.lang.String name)
|
byte |
getAsByte(java.lang.String name)
|
double |
getAsDouble(java.lang.String name)
|
float |
getAsFloat(java.lang.String name)
|
int |
getAsInt(java.lang.String name)
|
long |
getAsLong(java.lang.String name)
|
short |
getAsShort(java.lang.String name)
|
java.lang.String |
getAsString(java.lang.String name)
|
Parameters.Entry |
getEntry(int index)
Returns Parameters.Entry present at specified position in parameter list. |
java.lang.String |
getName(int index)
Returns name of the parameter at specified position in parameter list. |
int |
indexOf(java.lang.String name)
Returns index of the first occurrence of parameter name
or -1 if does not exist. |
void |
set(java.lang.String name,
boolean b)
Sets value of the parameter to string representation of boolean b . |
void |
set(java.lang.String name,
double x)
Sets value of the parameter to string representation of real number x . |
void |
set(java.lang.String name,
int k)
Sets value of the parameter to string representation of integer k . |
void |
set(java.lang.String name,
java.lang.String value)
Sets value of the parameter name to a given string value . |
int |
size()
Returns the number of defined parameters. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Parameters()
Method Detail |
---|
public int size()
public void clear()
public Parameters copy()
public void set(java.lang.String name, java.lang.String value)
name
to a given string value
.
If name
is null, does nothing.
Note that String is a canonical representation of parameter values
and all other types of values, passed to other variants of method set
,
are internally converted and stored as Strings.
public void set(java.lang.String name, int k)
k
.
public void set(java.lang.String name, double x)
x
.
Caution: x
is a real value and its conversion to String may
introduce rounding errors, so the value decoded later on may slightly
differ from the value passed to this method.
public void set(java.lang.String name, boolean b)
b
.
public int indexOf(java.lang.String name)
name
or -1 if does not exist.
public boolean exists(java.lang.String name)
name
- Name of the parameter
public final java.lang.String get(java.lang.String name) throws ParameterUndefinedException
ParameterUndefinedException
- if the parameter is not presentpublic Parameters.Entry getEntry(int index)
Parameters.Entry
present at specified position in parameter list.
index
- Index of the parameter in the list.public java.lang.String getName(int index)
index
- Index of the parameter in the list.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getAsString(java.lang.String name) throws ParameterUndefinedException
ParameterUndefinedException
public int getAsInt(java.lang.String name) throws ParameterUndefinedException, ParameterConversionException
ParameterUndefinedException
ParameterConversionException
public byte getAsByte(java.lang.String name) throws ParameterUndefinedException, ParameterConversionException
ParameterUndefinedException
ParameterConversionException
public short getAsShort(java.lang.String name) throws ParameterUndefinedException, ParameterConversionException
ParameterUndefinedException
ParameterConversionException
public long getAsLong(java.lang.String name) throws ParameterUndefinedException, ParameterConversionException
ParameterUndefinedException
ParameterConversionException
public double getAsDouble(java.lang.String name) throws ParameterUndefinedException, ParameterConversionException
ParameterUndefinedException
ParameterConversionException
public float getAsFloat(java.lang.String name) throws ParameterUndefinedException, ParameterConversionException
ParameterUndefinedException
ParameterConversionException
public boolean getAsBool(java.lang.String name) throws ParameterUndefinedException, ParameterConversionException
ParameterUndefinedException
ParameterConversionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |