Package weka.core

Class Settings.SettingKey

java.lang.Object
weka.core.Settings.SettingKey
All Implemented Interfaces:
Serializable
Enclosing class:
Settings

public static class Settings.SettingKey extends Object implements Serializable
Class implementing a key for a setting. Has a unique key, description, tool tip text and map of arbitrary other metadata
See Also:
  • Constructor Details

    • SettingKey

      public SettingKey()
      Construct a new empty setting key
    • SettingKey

      public SettingKey(String key, String description, String toolTip)
      Construct a new SettingKey with the given key, description and tool tip text
      Parameters:
      key - the key of this SettingKey
      description - the description (display name of the setting)
      toolTip - the tool tip text for the setting
    • SettingKey

      public SettingKey(String key, String description, String toolTip, List<String> pickList)
      Construct a new SettingKey with the given key, description, tool tip and pick list
      Parameters:
      key - the key of this SettingKey
      description - the description (display name of the setting)
      toolTip - the tool tip for the setting
      pickList - an optional list of legal values for a string setting
  • Method Details

    • setKey

      public void setKey(String key)
      set the key of this setting
      Parameters:
      key - the key to use
    • getKey

      public String getKey()
      Get the key of this setting
      Returns:
      the key of this setting
    • setDescription

      public void setDescription(String description)
      Set the description (display name) of this setting
      Parameters:
      description - the description of this setting
    • getDescription

      public String getDescription()
      Get the description (display name) of this setting
      Returns:
      the description of this setting
    • setToolTip

      public void setToolTip(String toolTip)
      Set the tool tip text for this setting
      Parameters:
      toolTip - the tool tip text to use
    • getToolTip

      public String getToolTip()
      Get the tool tip text for this setting
      Returns:
      the tool tip text to use
    • setMetadataElement

      public void setMetadataElement(String key, String value)
      Set the value of a piece of metadata for this setting
      Parameters:
      key - the key for the metadata
      value - the value of the metadata
    • getMetadataElement

      public String getMetadataElement(String key)
      Get a piece of metadata for this setting
      Parameters:
      key - the key of the metadata
      Returns:
      the corresponding value, or null if the key is not known
    • getMetadataElement

      public String getMetadataElement(String key, String defaultValue)
      Get a peice of metadata for this setting
      Parameters:
      key - the key of the metadata
      defaultValue - the default value for the metadata
      Returns:
      the corresponding value, or the default value if the key is not known
    • setMetadata

      public void setMetadata(Map<String,String> metadata)
      Set the metadata for this setting
      Parameters:
      metadata - the metadata for this setting
    • getMetadata

      public Map<String,String> getMetadata()
      Get the metadata for this setting
      Returns:
      the metadata for this setting
    • getPickList

      public List<String> getPickList()
      Get the optional pick list for the setting
      Returns:
      the optional pick list for the setting (can be null if not applicable)
    • setPickList

      public void setPickList(List<String> pickList)
      Set the optional pick list for the setting
      Parameters:
      pickList - the optional pick list for the setting (can be null if not applicable)
    • hashCode

      public int hashCode()
      Hashcode based on the key
      Overrides:
      hashCode in class Object
      Returns:
      the hashcode of this setting
    • equals

      public boolean equals(Object other)
      Compares two setting keys for equality
      Overrides:
      equals in class Object
      Parameters:
      other - the other setting key to compare to
      Returns:
      true if this setting key is equal to the supplied one
    • toString

      public String toString()
      Return the description (display name) of this setting
      Overrides:
      toString in class Object
      Returns:
      the description of this setting