com.rapidminer.parameter
Class ParameterType

java.lang.Object
  extended by com.rapidminer.parameter.ParameterType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
ParameterTypeConfiguration, ParameterTypeList, ParameterTypePreview, ParameterTypeSingle

public abstract class ParameterType
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

A ParameterType holds information about type, range, and default value of a parameter. Lists of ParameterTypes are provided by operators.

Author:
Ingo Mierswa, Simon Fischer
See Also:
Operator.getParameterTypes(), Serialized Form

Constructor Summary
ParameterType(java.lang.String key, java.lang.String description)
          Creates a new ParameterType.
 
Method Summary
 int compareTo(java.lang.Object o)
          ParameterTypes are compared by key.
abstract  java.lang.Object getDefaultValue()
          Returns a value that can be used if the parameter is not set.
 java.lang.String getDescription()
          Returns a short description.
 java.lang.String getKey()
          Returns the key.
abstract  java.lang.String getRange()
          Returns a human readable description of the range.
abstract  java.lang.String getXML(java.lang.String indent, java.lang.String key, java.lang.String value, boolean hideDefault)
          Writes an xml representation of the given key-value pair.
 void illegalValue(java.lang.Object illegal, java.lang.Object corrected)
          Can be called in order to report an illegal parameter value which is encountered during checkValue().
 boolean isExpert()
          Returns true if this parameter can only be seen in expert mode.
 boolean isHidden()
          Returns true if this parameter is hidden or not all dependency conditions are fullfilled.
abstract  boolean isNumerical()
          Returns true if the values of this parameter type are numerical, i.e. might be parsed by Double.parseDouble(String).
 boolean isOptional()
          Returns true if this parameter is optional.
 void registerDependencyCondition(ParameterCondition condition)
          Registers the given dependency condition.
abstract  void setDefaultValue(java.lang.Object defaultValue)
          Sets the default value.
 void setDescription(java.lang.String description)
          Sets the short description.
 void setExpert(boolean expert)
          Sets if this parameter can be seen in expert mode (true) or beginner mode (false).
 void setHidden(boolean hidden)
          Sets if this parameter is hidden (value true) and will not be shown in the GUI.
 void setKey(java.lang.String key)
          Sets the key.
 void setShowRange(boolean showRange)
           
 boolean showRange()
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.Object value)
          Returns a string representation of this value.
 java.lang.String toXMLString(java.lang.Object value)
           
 java.lang.String transformNewValue(java.lang.String value)
          This method will be invoked by the Parameters after a parameter was set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterType

public ParameterType(java.lang.String key,
                     java.lang.String description)
Creates a new ParameterType.

Method Detail

getRange

public abstract java.lang.String getRange()
Returns a human readable description of the range.


getDefaultValue

public abstract java.lang.Object getDefaultValue()
Returns a value that can be used if the parameter is not set.


setDefaultValue

public abstract void setDefaultValue(java.lang.Object defaultValue)
Sets the default value.


isNumerical

public abstract boolean isNumerical()
Returns true if the values of this parameter type are numerical, i.e. might be parsed by Double.parseDouble(String). Otherwise false should be returned. This method might be used by parameter logging operators.


getXML

public abstract java.lang.String getXML(java.lang.String indent,
                                        java.lang.String key,
                                        java.lang.String value,
                                        boolean hideDefault)
Writes an xml representation of the given key-value pair.


showRange

public boolean showRange()

setShowRange

public void setShowRange(boolean showRange)

transformNewValue

public java.lang.String transformNewValue(java.lang.String value)
This method will be invoked by the Parameters after a parameter was set. The default implementation is empty but subclasses might override this method, e.g. for a decryption of passwords.


isExpert

public boolean isExpert()
Returns true if this parameter can only be seen in expert mode. The default implementation returns true if the parameter is optional.


setExpert

public void setExpert(boolean expert)
Sets if this parameter can be seen in expert mode (true) or beginner mode (false).


isHidden

public boolean isHidden()
Returns true if this parameter is hidden or not all dependency conditions are fullfilled. Then the parameter will not be shown in the GUI. The default implementation returns true which should be the normal case.


setHidden

public void setHidden(boolean hidden)
Sets if this parameter is hidden (value true) and will not be shown in the GUI.


registerDependencyCondition

public void registerDependencyCondition(ParameterCondition condition)
Registers the given dependency condition.


isOptional

public boolean isOptional()
Returns true if this parameter is optional. The default implementation returns true.


setKey

public void setKey(java.lang.String key)
Sets the key.


getKey

public java.lang.String getKey()
Returns the key.


getDescription

public java.lang.String getDescription()
Returns a short description.


setDescription

public void setDescription(java.lang.String description)
Sets the short description.


toString

public java.lang.String toString(java.lang.Object value)
Returns a string representation of this value.


toXMLString

public java.lang.String toXMLString(java.lang.Object value)

toString

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

illegalValue

public void illegalValue(java.lang.Object illegal,
                         java.lang.Object corrected)
Can be called in order to report an illegal parameter value which is encountered during checkValue().


compareTo

public int compareTo(java.lang.Object o)
ParameterTypes are compared by key.

Specified by:
compareTo in interface java.lang.Comparable


Copyright © 2001-2009 by Rapid-I