com.rapidminer.parameter
Class ParameterTypeCategory

java.lang.Object
  extended by com.rapidminer.parameter.ParameterType
      extended by com.rapidminer.parameter.ParameterTypeSingle
          extended by com.rapidminer.parameter.ParameterTypeCategory
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class ParameterTypeCategory
extends ParameterTypeSingle

A parameter type for categories. These are several Strings and one of these is the default value. Operators ask for the index of the selected value with Operator.getParameterAsInt(String).

Author:
Ingo Mierswa, Simon Fischer ingomierswa Exp $
See Also:
Serialized Form

Constructor Summary
ParameterTypeCategory(java.lang.String key, java.lang.String description, java.lang.String[] categories, int defaultValue)
           
 
Method Summary
 java.lang.String getCategory(int index)
           
 int getDefault()
           
 java.lang.Object getDefaultValue()
          Returns a value that can be used if the parameter is not set.
 int getIndex(java.lang.String string)
           
 int getNumberOfCategories()
           
 java.lang.String getRange()
          Returns a human readable description of the range.
 java.lang.String[] getValues()
           
 boolean isNumerical()
          Returns false.
 boolean isOptional()
          Returns true if this parameter is optional.
 void setDefaultValue(java.lang.Object defaultValue)
          Sets the default value.
 java.lang.String toString(java.lang.Object value)
          Returns a string representation of this value.
 
Methods inherited from class com.rapidminer.parameter.ParameterTypeSingle
getXML
 
Methods inherited from class com.rapidminer.parameter.ParameterType
compareTo, getDescription, getKey, illegalValue, isExpert, isHidden, registerDependencyCondition, setDescription, setExpert, setHidden, setKey, setShowRange, showRange, toString, toXMLString, transformNewValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterTypeCategory

public ParameterTypeCategory(java.lang.String key,
                             java.lang.String description,
                             java.lang.String[] categories,
                             int defaultValue)
Method Detail

isOptional

public boolean isOptional()
Description copied from class: ParameterType
Returns true if this parameter is optional. The default implementation returns true.

Overrides:
isOptional in class ParameterType

getDefault

public int getDefault()

getDefaultValue

public java.lang.Object getDefaultValue()
Description copied from class: ParameterType
Returns a value that can be used if the parameter is not set.

Specified by:
getDefaultValue in class ParameterType

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)
Description copied from class: ParameterType
Sets the default value.

Specified by:
setDefaultValue in class ParameterType

isNumerical

public boolean isNumerical()
Returns false.

Specified by:
isNumerical in class ParameterType

getCategory

public java.lang.String getCategory(int index)

getIndex

public int getIndex(java.lang.String string)

toString

public java.lang.String toString(java.lang.Object value)
Description copied from class: ParameterType
Returns a string representation of this value.

Overrides:
toString in class ParameterType

getValues

public java.lang.String[] getValues()

getRange

public java.lang.String getRange()
Description copied from class: ParameterType
Returns a human readable description of the range.

Specified by:
getRange in class ParameterType

getNumberOfCategories

public int getNumberOfCategories()


Copyright © 2001-2009 by Rapid-I