Package org.esa.snap.core.util
Interface PropertyMap
- All Known Implementing Classes:
AbstractPropertyMap,DefaultPropertyMap,PreferencesPropertyMap
public interface PropertyMap
The
PropertyMap class can be used instead of the standard JDK java.util.Properties
class.PropertyMap provides a generally more useful interface by adding a couple type conversion methods
for a set of most frequently used data types, such as Boolean, Integer,
Double, Color and Font.
Additionally the class provides property change support.
- Since:
- SNAP 2 (revision)
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddPropertyChangeListener(String key, PropertyChangeListener listener) Returns thePropertiesinstance in which this property map stores its key/value pairs.booleangetPropertyBool(String key) getPropertyBool(String key, Boolean defaultValue) getPropertyColor(String key) getPropertyColor(String key, Color defaultValue) doublegetPropertyDouble(String key) getPropertyDouble(String key, Double defaultValue) getPropertyFont(String key) getPropertyFont(String key, Font defaultValue) intgetPropertyInt(String key) getPropertyInt(String key, Integer defaultValue) Returns an enumeration of the property keys in this map.getPropertyString(String key) getPropertyString(String key, String defaultValue) voidLoads key/value pairs from a text file into this property map.voidvoidremovePropertyChangeListener(String key, PropertyChangeListener listener) voidsetPropertyBool(String key, Boolean newValue) voidsetPropertyColor(String key, Color newValue) voidsetPropertyDouble(String key, Double value) voidsetPropertyFont(String key, Font font) voidsetPropertyInt(String key, Integer value) voidsetPropertyString(String key, String value) voidStores the key/value pairs of this property map into a text file.
-
Method Details
-
load
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
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
Properties getProperties()Returns thePropertiesinstance in which this property map stores its key/value pairs. -
getPropertyKeys
Returns an enumeration of the property keys in this map. -
getPropertyBool
-
getPropertyBool
-
setPropertyBool
-
getPropertyInt
-
getPropertyInt
-
setPropertyInt
-
getPropertyDouble
-
getPropertyDouble
-
setPropertyDouble
-
getPropertyString
-
getPropertyString
-
setPropertyString
-
getPropertyColor
-
getPropertyColor
-
setPropertyColor
-
getPropertyFont
-
getPropertyFont
-
setPropertyFont
-
addPropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
removePropertyChangeListener
-