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 SettingsNO_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 voidclearAllSettings()Removes all name-value pairs from this settings objectvoidclearSetting(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 nameSettingsgetDefaultSettings()Returns the underlying default settings for these settings or null if there are nonejava.lang.LonggetLong(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.StringgetString(java.lang.String name)Gets the String value associated with the given namejava.lang.ObjectgetValue(java.lang.String name)Gets the object associated with the given namebooleanisEmpty()Returns true if there are no key-value pairs stored in this settings objectvoidsetByteArray(java.lang.String name, byte[] value)Associates the given byte[] with the namevoidsetDefaultSettings(Settings settings)voidsetLong(java.lang.String name, long value)Associates the given long value with the namevoidsetString(java.lang.String name, java.lang.String value)Associates the given String value with the namevoidsetValue(java.lang.String name, java.lang.Object value)Associates the given object with the namejava.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
isEmpty
public boolean isEmpty()
Description copied from interface:SettingsReturns true if there are no key-value pairs stored in this settings object- Specified by:
isEmptyin interfaceSettings- See Also:
Settings.isEmpty()
-
getLong
public java.lang.Long getLong(java.lang.String name)
Description copied from interface:SettingsGets the Long value associated with the given name- Specified by:
getLongin 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:SettingsGets the String value associated with the given name- Specified by:
getStringin 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:SettingsGets the byte[] value associated with the given name- Specified by:
getByteArrayin 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:SettingsAssociates the given long value with the name- Specified by:
setLongin 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:SettingsAssociates the given String value with the name- Specified by:
setStringin 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:SettingsAssociates the given byte[] with the name- Specified by:
setByteArrayin 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:SettingsRemoves any value associated with the given name- Specified by:
clearSettingin 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:SettingsGet this list of keys that currently have values associated with them- Specified by:
getNamesin 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:SettingsGets the object associated with the given name- Specified by:
getValuein 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:SettingsAssociates the given object with the name- Specified by:
setValuein 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:SettingsRemoves all name-value pairs from this settings object- Specified by:
clearAllSettingsin interfaceSettings- See Also:
Settings.clearAllSettings()
-
setDefaultSettings
public void setDefaultSettings(Settings settings)
-
getDefaultSettings
public Settings getDefaultSettings()
Description copied from interface:SettingsReturns the underlying default settings for these settings or null if there are none- Specified by:
getDefaultSettingsin interfaceSettings- See Also:
Settings.getDefaultSettings()
-
-