|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.udo.cs.yale.operator.parameter.Parameters
public class Parameters
This class is a collection of the parameter values of a single operator.
Instances of Parameters are created with respect to the
declared list of ParameterTypes of an operator. If parameters
are set using the setParameter() method and the value exceeds
the range, it is automatically corrected. If parameters are queried that are
not set, their default value is returned.
| Field Summary | |
|---|---|
private java.util.SortedMap<java.lang.String,ParameterType> |
keyToTypeMap
Maps parameter keys (i.e. |
private java.util.SortedMap<java.lang.String,java.lang.Object> |
keyToValueMap
Maps parameter keys (i.e. |
| Constructor Summary | |
|---|---|
Parameters()
Creates an empty parameters object without any parameter types. |
|
Parameters(java.util.List<ParameterType> parameterTypes)
Constructs an instance of Parameters for the given list of
ParameterTypes. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Performs a deep clone on this parameters object. |
void |
copy(Parameters parameters)
Copies the values and types of the given Parameters object into this one. |
boolean |
equals(java.lang.Object o)
Returns true if the given parameters are not null and are the same like this parameters. |
java.util.Set<java.lang.String> |
getKeys()
Returns a set view of all parameter keys. |
java.lang.Object |
getParameter(java.lang.String key)
Returns the value of the given parameter. |
ParameterType |
getParameterType(java.lang.String key)
Returns the type of the parameter with the given type. |
java.lang.String |
getXML(java.lang.String indent)
Writes a portion of the xml configuration file specifying the parameters that differ from their default value. |
void |
setParameter(java.lang.String key,
java.lang.Object value)
Sets the parameter for the given key after performing a range-check. |
void |
setParameterWithoutCheck(java.lang.String key,
java.lang.Object value)
Sets the parameter without performing a range check. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.SortedMap<java.lang.String,java.lang.Object> keyToValueMap
private java.util.SortedMap<java.lang.String,ParameterType> keyToTypeMap
ParameterType.
| Constructor Detail |
|---|
public Parameters()
public Parameters(java.util.List<ParameterType> parameterTypes)
Parameters for the given list of
ParameterTypes. The list might be empty but not null.
| Method Detail |
|---|
public void copy(Parameters parameters)
public java.lang.Object clone()
clone in class java.lang.Objectpublic ParameterType getParameterType(java.lang.String key)
public void setParameter(java.lang.String key,
java.lang.Object value)
public void setParameterWithoutCheck(java.lang.String key,
java.lang.Object value)
public java.lang.Object getParameter(java.lang.String key)
throws UndefinedParameterError
ParameterType does not provide a default value, this may
result in an error message. In subsequent calls of this method, the
parameter will be set. An OperatorException (UserError) will be thrown if
a non-optional parameter was not set.
UndefinedParameterErrorpublic java.util.Set<java.lang.String> getKeys()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String getXML(java.lang.String indent)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||