Package weka.core
Class Settings.SettingKey
- java.lang.Object
-
- weka.core.Settings.SettingKey
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- Settings
public static class Settings.SettingKey extends java.lang.Object implements java.io.SerializableClass implementing a key for a setting. Has a unique key, description, tool tip text and map of arbitrary other metadata- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SettingKey()Construct a new empty setting keySettingKey(java.lang.String key, java.lang.String description, java.lang.String toolTip)Construct a new SettingKey with the given key, description and tool tip textSettingKey(java.lang.String key, java.lang.String description, java.lang.String toolTip, java.util.List<java.lang.String> pickList)Construct a new SettingKey with the given key, description, tool tip and pick list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Compares two setting keys for equalityjava.lang.StringgetDescription()Get the description (display name) of this settingjava.lang.StringgetKey()Get the key of this settingjava.util.Map<java.lang.String,java.lang.String>getMetadata()Get the metadata for this settingjava.lang.StringgetMetadataElement(java.lang.String key)Get a piece of metadata for this settingjava.lang.StringgetMetadataElement(java.lang.String key, java.lang.String defaultValue)Get a peice of metadata for this settingjava.util.List<java.lang.String>getPickList()Get the optional pick list for the settingjava.lang.StringgetToolTip()Get the tool tip text for this settinginthashCode()Hashcode based on the keyvoidsetDescription(java.lang.String description)Set the description (display name) of this settingvoidsetKey(java.lang.String key)set the key of this settingvoidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set the metadata for this settingvoidsetMetadataElement(java.lang.String key, java.lang.String value)Set the value of a piece of metadata for this settingvoidsetPickList(java.util.List<java.lang.String> pickList)Set the optional pick list for the settingvoidsetToolTip(java.lang.String toolTip)Set the tool tip text for this settingjava.lang.StringtoString()Return the description (display name) of this setting
-
-
-
Constructor Detail
-
SettingKey
public SettingKey()
Construct a new empty setting key
-
SettingKey
public SettingKey(java.lang.String key, java.lang.String description, java.lang.String toolTip)Construct a new SettingKey with the given key, description and tool tip text- Parameters:
key- the key of this SettingKeydescription- the description (display name of the setting)toolTip- the tool tip text for the setting
-
SettingKey
public SettingKey(java.lang.String key, java.lang.String description, java.lang.String toolTip, java.util.List<java.lang.String> pickList)Construct a new SettingKey with the given key, description, tool tip and pick list- Parameters:
key- the key of this SettingKeydescription- the description (display name of the setting)toolTip- the tool tip for the settingpickList- an optional list of legal values for a string setting
-
-
Method Detail
-
setKey
public void setKey(java.lang.String key)
set the key of this setting- Parameters:
key- the key to use
-
getKey
public java.lang.String getKey()
Get the key of this setting- Returns:
- the key of this setting
-
setDescription
public void setDescription(java.lang.String description)
Set the description (display name) of this setting- Parameters:
description- the description of this setting
-
getDescription
public java.lang.String getDescription()
Get the description (display name) of this setting- Returns:
- the description of this setting
-
setToolTip
public void setToolTip(java.lang.String toolTip)
Set the tool tip text for this setting- Parameters:
toolTip- the tool tip text to use
-
getToolTip
public java.lang.String getToolTip()
Get the tool tip text for this setting- Returns:
- the tool tip text to use
-
setMetadataElement
public void setMetadataElement(java.lang.String key, java.lang.String value)Set the value of a piece of metadata for this setting- Parameters:
key- the key for the metadatavalue- the value of the metadata
-
getMetadataElement
public java.lang.String getMetadataElement(java.lang.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 java.lang.String getMetadataElement(java.lang.String key, java.lang.String defaultValue)Get a peice of metadata for this setting- Parameters:
key- the key of the metadatadefaultValue- the default value for the metadata- Returns:
- the corresponding value, or the default value if the key is not known
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set the metadata for this setting- Parameters:
metadata- the metadata for this setting
-
getMetadata
public java.util.Map<java.lang.String,java.lang.String> getMetadata()
Get the metadata for this setting- Returns:
- the metadata for this setting
-
getPickList
public java.util.List<java.lang.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(java.util.List<java.lang.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:
hashCodein classjava.lang.Object- Returns:
- the hashcode of this setting
-
equals
public boolean equals(java.lang.Object other)
Compares two setting keys for equality- Overrides:
equalsin classjava.lang.Object- Parameters:
other- the other setting key to compare to- Returns:
- true if this setting key is equal to the supplied one
-
toString
public java.lang.String toString()
Return the description (display name) of this setting- Overrides:
toStringin classjava.lang.Object- Returns:
- the description of this setting
-
-