public class DefaultPropertyMap extends AbstractPropertyMap
PropertyMap
interface backed by a Properties
instance.DEFAULT_COLOR, DEFAULT_FONT
Constructor and Description |
---|
DefaultPropertyMap()
Constructs a new and empty property map.
|
DefaultPropertyMap(Properties properties)
Constructs a property map which uses the given
Properties as a key/value container. |
Modifier and Type | Method and 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 the
Properties 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.
|
getPropertyBool, getPropertyBool, getPropertyColor, getPropertyColor, getPropertyDouble, getPropertyDouble, getPropertyFont, getPropertyFont, getPropertyInt, getPropertyInt, getPropertyString, getPropertyString, setPropertyBool, setPropertyColor, setPropertyDouble, setPropertyFont, setPropertyInt, setPropertyString
public DefaultPropertyMap()
public DefaultPropertyMap(Properties properties)
Properties
as a key/value container.public void load(Path file) throws IOException
file
- the text fileIOException
- if an I/O error occurspublic void store(Path file, String header) throws IOException
file
- the text fileheader
- an optional file headerIOException
- if an I/O error occurspublic Properties getProperties()
Properties
instance in which this property map stores its key/value pairs.public Set<String> getPropertyKeys()
protected String get(String key)
get
in class AbstractPropertyMap
protected String get(String key, String defaultValue)
get
in class AbstractPropertyMap
protected String set(String key, String value)
set
in class AbstractPropertyMap
public void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String key, PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String key, PropertyChangeListener listener)
protected void firePropertyChange(String key, String oldValue, String newValue)
firePropertyChange
in class AbstractPropertyMap
Copyright © 2014–2016 European Space Agency (ESA). All rights reserved.