Package ghidra.docking.settings

# Class FloatingPointPrecisionSettingsDefinition

java.lang.Object
ghidra.docking.settings.FloatingPointPrecisionSettingsDefinition

All Implemented Interfaces:
  `EnumSettingsDefinition`, `SettingsDefinition`

public class FloatingPointPrecisionSettingsDefinition extends Object implements EnumSettingsDefinition
SettingsDefinition to define the number of digits of precision to show. The value is rendered to thousandths, 3 digits of precision, by default.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final FloatingPointPrecisionSettingsDefinition`
  `DEF`
  Default definition.
  `static final int`
  `MAX_PRECISION`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear(Settings settings)`
  Removes any values in the given settings object associated with this settings definition
  `void`
  `copySetting(Settings settings, Settings destSettings)`
  Copies any setting value associated with this settings definition from the srcSettings settings to the destSettings.
  `int`
  `getChoice(Settings settings)`
  Returns the current value for this settings
  `int`
  `getChoice(String displayChoice, Settings settings)`
  `String`
  `getDescription()`
  Returns a description of this settings definition
  `String`
  `getDisplayChoice(int value, Settings s1)`
  Returns the String for the given enum value
  `String[]`
  `getDisplayChoices(Settings settings)`
  Gets the list of choices as strings based on the current settings
  `String`
  `getName()`
  Returns the display name of this SettingsDefinition
  `int`
  `getPrecision(Settings settings)`
  `String`
  `getStorageKey()`
  Get the `Settings` key which is used when storing a key/value entry.
  `String`
  `getValueString(Settings settings)`
  Get the setting value as a string which corresponds to this definition.
  `boolean`
  `hasValue(Settings setting)`
  Determine if a setting value has been stored
  `void`
  `setChoice(Settings settings, int valueIndex)`
  Sets the given value into the settings object using this definition as a key
  `void`
  `setPrecision(Settings settings, int digits)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.docking.settings.EnumSettingsDefinition

  `hasSameValue`

- ## Field Details

  - ### DEF

    public static final FloatingPointPrecisionSettingsDefinition DEF
    Default definition.

  - ### MAX_PRECISION

    public static final int MAX_PRECISION

- ## Method Details

  - ### getPrecision

    public int getPrecision(Settings settings)

  - ### setPrecision

    public void setPrecision(Settings settings, int digits)

  - ### getChoice

    public int getChoice(Settings settings)
    Description copied from interface: `EnumSettingsDefinition`
    Returns the current value for this settings
    Specified by:
      `getChoice` in interface `EnumSettingsDefinition`
    Parameters:
      `settings` - The settings to search
    Returns:
      the value for the settingsDefintions

  - ### getValueString

    public String getValueString(Settings settings)
    Description copied from interface: `SettingsDefinition`
    Get the setting value as a string which corresponds to this definition. A default value string will be returned if a setting has not been stored.
    Specified by:
      `getValueString` in interface `SettingsDefinition`
    Parameters:
      `settings` - settings
    Returns:
      value string or null if not set and default has not specified by this definition

  - ### setChoice

    public void setChoice(Settings settings, int valueIndex)
    Description copied from interface: `EnumSettingsDefinition`
    Sets the given value into the settings object using this definition as a key
    Specified by:
      `setChoice` in interface `EnumSettingsDefinition`
    Parameters:
      `settings` - the settings to store the value.
      `valueIndex` - the settings value to be stored.

  - ### getDisplayChoices

    public String[] getDisplayChoices(Settings settings)
    Description copied from interface: `EnumSettingsDefinition`
    Gets the list of choices as strings based on the current settings
    Specified by:
      `getDisplayChoices` in interface `EnumSettingsDefinition`
    Parameters:
      `settings` - the instance settings
    Returns:
      an array of strings which represent valid choices based on the current settings.

  - ### getName

    public String getName()
    Description copied from interface: `SettingsDefinition`
    Returns the display name of this SettingsDefinition
    Specified by:
      `getName` in interface `SettingsDefinition`
    Returns:
      display name for setting

  - ### getStorageKey

    public String getStorageKey()
    Description copied from interface: `SettingsDefinition`
    Get the `Settings` key which is used when storing a key/value entry.
    Specified by:
      `getStorageKey` in interface `SettingsDefinition`
    Returns:
      settings storage key

  - ### getDescription

    public String getDescription()
    Description copied from interface: `SettingsDefinition`
    Returns a description of this settings definition
    Specified by:
      `getDescription` in interface `SettingsDefinition`
    Returns:
      setting description

  - ### getChoice

    public int getChoice(String displayChoice, Settings settings)

  - ### getDisplayChoice

    public String getDisplayChoice(int value, Settings s1)
    Description copied from interface: `EnumSettingsDefinition`
    Returns the String for the given enum value
    Specified by:
      `getDisplayChoice` in interface `EnumSettingsDefinition`
    Parameters:
      `value` - the value to get a display string for
      `s1` - the instance settings which may affect the results
    Returns:
      the display string for the given settings.

  - ### clear

    public void clear(Settings settings)
    Description copied from interface: `SettingsDefinition`
    Removes any values in the given settings object associated with this settings definition
    Specified by:
      `clear` in interface `SettingsDefinition`
    Parameters:
      `settings` - the settings object to be cleared.

  - ### copySetting

    public void copySetting(Settings settings, Settings destSettings)
    Description copied from interface: `SettingsDefinition`
    Copies any setting value associated with this settings definition from the srcSettings settings to the destSettings.
    Specified by:
      `copySetting` in interface `SettingsDefinition`
    Parameters:
      `settings` - the settings to be copied
      `destSettings` - the settings to be updated.

  - ### hasValue

    public boolean hasValue(Settings setting)
    Description copied from interface: `SettingsDefinition`
    Determine if a setting value has been stored
    Specified by:
      `hasValue` in interface `SettingsDefinition`
    Parameters:
      `setting` - stored settings
    Returns:
      true if a value has been stored, else false