com.rapidminer.parameter
Class Parameters

java.lang.Object
  extended by com.rapidminer.parameter.Parameters
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<java.lang.String>

public class Parameters
extends java.lang.Object
implements java.lang.Cloneable, java.lang.Iterable<java.lang.String>

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.

Author:
Ingo Mierswa, Simon Fischer

Field Summary
static char PAIR_SEPARATOR
           
static char RECORD_SEPARATOR
           
 
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.
 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.String 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, boolean hideDefault)
          Writes a portion of the xml configuration file specifying the parameters that differ from their default value.
 int hashCode()
           
 java.util.Iterator<java.lang.String> iterator()
           
 int notifyRenaming(java.lang.String oldName, java.lang.String newName)
           
 boolean setParameter(java.lang.String key, java.lang.String value)
          Sets the parameter for the given key after performing a range-check.
 void setParameterWithoutCheck(java.lang.String key, java.lang.String value)
          Deprecated. Please use the method setParameter(String, String) instead
 java.lang.String toString()
           
static java.lang.String transformList2String(java.util.List<java.lang.String[]> parameterList)
           
static java.util.List<java.lang.String[]> transformString2List(java.lang.String listString)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PAIR_SEPARATOR

public static final char PAIR_SEPARATOR
See Also:
Constant Field Values

RECORD_SEPARATOR

public static final char RECORD_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

Parameters

public Parameters()
Creates an empty parameters object without any parameter types.


Parameters

public Parameters(java.util.List<ParameterType> parameterTypes)
Constructs an instance of Parameters for the given list of ParameterTypes. The list might be empty but not null.

Method Detail

clone

public java.lang.Object clone()
Performs a deep clone on this parameters object.

Overrides:
clone in class java.lang.Object

iterator

public java.util.Iterator<java.lang.String> iterator()
Specified by:
iterator in interface java.lang.Iterable<java.lang.String>

getParameterType

public ParameterType getParameterType(java.lang.String key)
Returns the type of the parameter with the given type.


setParameter

public boolean setParameter(java.lang.String key,
                            java.lang.String value)
Sets the parameter for the given key after performing a range-check. This method returns true if the type was known and false if no parameter type was defined for this key.


setParameterWithoutCheck

@Deprecated
public void setParameterWithoutCheck(java.lang.String key,
                                                java.lang.String value)
Deprecated. Please use the method setParameter(String, String) instead

Sets the parameter without performing a range and type check.


getParameter

public java.lang.String getParameter(java.lang.String key)
                              throws UndefinedParameterError
Returns the value of the given parameter. If it was not yet set, the default value is set now and a log message is issued. If the 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.

Throws:
UndefinedParameterError

getKeys

public java.util.Set<java.lang.String> getKeys()
Returns a set view of all parameter keys.


equals

public boolean equals(java.lang.Object o)
Returns true if the given parameters are not null and are the same like this parameters.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getXML

public java.lang.String getXML(java.lang.String indent,
                               boolean hideDefault)
Writes a portion of the xml configuration file specifying the parameters that differ from their default value.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

transformList2String

public static java.lang.String transformList2String(java.util.List<java.lang.String[]> parameterList)

transformString2List

public static java.util.List<java.lang.String[]> transformString2List(java.lang.String listString)

notifyRenaming

public int notifyRenaming(java.lang.String oldName,
                          java.lang.String newName)


Copyright © 2001-2009 by Rapid-I