Package ghidra.docking.settings
Class SettingsImpl
- java.lang.Object
-
- ghidra.docking.settings.SettingsImpl
-
- All Implemented Interfaces:
Settings
,java.io.Serializable
public class SettingsImpl extends java.lang.Object implements Settings, java.io.Serializable
Basic implementation of the Settings object- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Settings
NO_SETTINGS
-
Constructor Summary
Constructors Constructor Description SettingsImpl()
Construct a new SettingsImplSettingsImpl(Settings settings)
Construct a new SettingsImpl object with the same set of name-value pairs as the given settings objectSettingsImpl(javax.swing.event.ChangeListener listener, java.lang.Object changeSourceObj)
Construct a new SettingsImpl with the given listener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAllSettings()
Removes all name-value pairs from this settings objectvoid
clearSetting(java.lang.String name)
Removes any value associated with the given namebyte[]
getByteArray(java.lang.String name)
Gets the byte[] value associated with the given nameSettings
getDefaultSettings()
Returns the underlying default settings for these settings or null if there are nonejava.lang.Long
getLong(java.lang.String name)
Gets the Long value associated with the given namejava.lang.String[]
getNames()
Get this list of keys that currently have values associated with themjava.lang.String
getString(java.lang.String name)
Gets the String value associated with the given namejava.lang.Object
getValue(java.lang.String name)
Gets the object associated with the given nameboolean
isEmpty()
Returns true if there are no key-value pairs stored in this settings objectvoid
setByteArray(java.lang.String name, byte[] value)
Associates the given byte[] with the namevoid
setDefaultSettings(Settings settings)
void
setLong(java.lang.String name, long value)
Associates the given long value with the namevoid
setString(java.lang.String name, java.lang.String value)
Associates the given String value with the namevoid
setValue(java.lang.String name, java.lang.Object value)
Associates the given object with the namejava.lang.String
toString()
-
-
-
Field Detail
-
NO_SETTINGS
public static final Settings NO_SETTINGS
-
-
Constructor Detail
-
SettingsImpl
public SettingsImpl()
Construct a new SettingsImpl
-
SettingsImpl
public SettingsImpl(javax.swing.event.ChangeListener listener, java.lang.Object changeSourceObj)
Construct a new SettingsImpl with the given listener- Parameters:
listener
- object to be notified as settings values changechangeSourceObj
- source object to be associated with change events
-
SettingsImpl
public SettingsImpl(Settings settings)
Construct a new SettingsImpl object with the same set of name-value pairs as the given settings object- Parameters:
settings
- the settings object to copy
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isEmpty
public boolean isEmpty()
Description copied from interface:Settings
Returns true if there are no key-value pairs stored in this settings object- Specified by:
isEmpty
in interfaceSettings
- See Also:
Settings.isEmpty()
-
getLong
public java.lang.Long getLong(java.lang.String name)
Description copied from interface:Settings
Gets the Long value associated with the given name- Specified by:
getLong
in interfaceSettings
- Parameters:
name
- the key used to retrieve a value- Returns:
- the Long value for a key
- See Also:
Settings.getLong(java.lang.String)
-
getString
public java.lang.String getString(java.lang.String name)
Description copied from interface:Settings
Gets the String value associated with the given name- Specified by:
getString
in interfaceSettings
- Parameters:
name
- the key used to retrieve a value- Returns:
- the String value for a key
- See Also:
Settings.getString(java.lang.String)
-
getByteArray
public byte[] getByteArray(java.lang.String name)
Description copied from interface:Settings
Gets the byte[] value associated with the given name- Specified by:
getByteArray
in interfaceSettings
- Parameters:
name
- the key used to retrieve a value- Returns:
- the byte[] value for a key
- See Also:
Settings.getByteArray(java.lang.String)
-
setLong
public void setLong(java.lang.String name, long value)
Description copied from interface:Settings
Associates the given long value with the name- Specified by:
setLong
in interfaceSettings
- Parameters:
name
- the keyvalue
- the value associated with the key- See Also:
Settings.setLong(java.lang.String, long)
-
setString
public void setString(java.lang.String name, java.lang.String value)
Description copied from interface:Settings
Associates the given String value with the name- Specified by:
setString
in interfaceSettings
- Parameters:
name
- the keyvalue
- the value associated with the key- See Also:
Settings.setString(java.lang.String, java.lang.String)
-
setByteArray
public void setByteArray(java.lang.String name, byte[] value)
Description copied from interface:Settings
Associates the given byte[] with the name- Specified by:
setByteArray
in interfaceSettings
- Parameters:
name
- the keyvalue
- the value associated with the key- See Also:
Settings.setByteArray(java.lang.String, byte[])
-
clearSetting
public void clearSetting(java.lang.String name)
Description copied from interface:Settings
Removes any value associated with the given name- Specified by:
clearSetting
in interfaceSettings
- Parameters:
name
- the key to remove any association- See Also:
Settings.clearSetting(java.lang.String)
-
getNames
public java.lang.String[] getNames()
Description copied from interface:Settings
Get this list of keys that currently have values associated with them- Specified by:
getNames
in interfaceSettings
- Returns:
- an array of string keys.
- See Also:
Settings.getNames()
-
getValue
public java.lang.Object getValue(java.lang.String name)
Description copied from interface:Settings
Gets the object associated with the given name- Specified by:
getValue
in interfaceSettings
- Parameters:
name
- the key used to retrieve a value- Returns:
- the object associated with a given key
- See Also:
Settings.getValue(java.lang.String)
-
setValue
public void setValue(java.lang.String name, java.lang.Object value)
Description copied from interface:Settings
Associates the given object with the name- Specified by:
setValue
in interfaceSettings
- Parameters:
name
- the keyvalue
- the value to associate with the key- See Also:
Settings.setValue(java.lang.String, java.lang.Object)
-
clearAllSettings
public void clearAllSettings()
Description copied from interface:Settings
Removes all name-value pairs from this settings object- Specified by:
clearAllSettings
in interfaceSettings
- See Also:
Settings.clearAllSettings()
-
setDefaultSettings
public void setDefaultSettings(Settings settings)
-
getDefaultSettings
public Settings getDefaultSettings()
Description copied from interface:Settings
Returns the underlying default settings for these settings or null if there are none- Specified by:
getDefaultSettings
in interfaceSettings
- See Also:
Settings.getDefaultSettings()
-
-