Package org.esa.snap.core.util
Class DefaultPropertyMap
- java.lang.Object
-
- org.esa.snap.core.util.AbstractPropertyMap
-
- org.esa.snap.core.util.DefaultPropertyMap
-
- All Implemented Interfaces:
PropertyMap
public class DefaultPropertyMap extends AbstractPropertyMap
Default implementation of thePropertyMap
interface backed by aProperties
instance.- Since:
- SNAP 2
-
-
Field Summary
-
Fields inherited from class org.esa.snap.core.util.AbstractPropertyMap
DEFAULT_COLOR, DEFAULT_FONT
-
-
Constructor Summary
Constructors Constructor Description DefaultPropertyMap()
Constructs a new and empty property map.DefaultPropertyMap(Properties properties)
Constructs a property map which uses the givenProperties
as a key/value container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener listener)
void
addPropertyChangeListener(String key, PropertyChangeListener listener)
protected void
firePropertyChange(String key, String oldValue, String newValue)
protected String
get(String key)
protected String
get(String key, String defaultValue)
Properties
getProperties()
Returns theProperties
instance in which this property map stores its key/value pairs.Set<String>
getPropertyKeys()
Returns an enumeration of the property keys in this map.void
load(Path file)
Loads key/value pairs from a text file into this property map.void
removePropertyChangeListener(PropertyChangeListener listener)
void
removePropertyChangeListener(String key, PropertyChangeListener listener)
protected String
set(String key, String value)
void
store(Path file, String header)
Stores the key/value pairs of this property map into a text file.-
Methods inherited from class org.esa.snap.core.util.AbstractPropertyMap
getPropertyBool, getPropertyBool, getPropertyColor, getPropertyColor, getPropertyDouble, getPropertyDouble, getPropertyFont, getPropertyFont, getPropertyInt, getPropertyInt, getPropertyString, getPropertyString, setPropertyBool, setPropertyColor, setPropertyDouble, setPropertyFont, setPropertyInt, setPropertyString
-
-
-
-
Constructor Detail
-
DefaultPropertyMap
public DefaultPropertyMap()
Constructs a new and empty property map.
-
DefaultPropertyMap
public DefaultPropertyMap(Properties properties)
Constructs a property map which uses the givenProperties
as a key/value container.
-
-
Method Detail
-
load
public void load(Path file) throws IOException
Loads key/value pairs from a text file into this property map.- Parameters:
file
- the text file- Throws:
IOException
- if an I/O error occurs
-
store
public void store(Path file, String header) throws IOException
Stores the key/value pairs of this property map into a text file.- Parameters:
file
- the text fileheader
- an optional file header- Throws:
IOException
- if an I/O error occurs
-
getProperties
public Properties getProperties()
Returns theProperties
instance in which this property map stores its key/value pairs.
-
getPropertyKeys
public Set<String> getPropertyKeys()
Returns an enumeration of the property keys in this map.
-
get
protected String get(String key)
- Specified by:
get
in classAbstractPropertyMap
-
get
protected String get(String key, String defaultValue)
- Specified by:
get
in classAbstractPropertyMap
-
set
protected String set(String key, String value)
- Specified by:
set
in classAbstractPropertyMap
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
-
addPropertyChangeListener
public void addPropertyChangeListener(String key, PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(String key, PropertyChangeListener listener)
-
firePropertyChange
protected void firePropertyChange(String key, String oldValue, String newValue)
- Specified by:
firePropertyChange
in classAbstractPropertyMap
-
-