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 Detail

      • load

        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

        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 file
        header - an optional file header
        Throws:
        IOException - if an I/O error occurs
      • getProperties

        Properties getProperties()
        Returns the Properties instance in which this property map stores its key/value pairs.
      • getPropertyKeys

        Set<String> getPropertyKeys()
        Returns an enumeration of the property keys in this map.
      • getPropertyBool

        boolean getPropertyBool​(String key)
      • setPropertyBool

        void setPropertyBool​(String key,
                             Boolean newValue)
      • getPropertyInt

        int getPropertyInt​(String key)
      • setPropertyInt

        void setPropertyInt​(String key,
                            Integer value)
      • getPropertyDouble

        double getPropertyDouble​(String key)
      • setPropertyDouble

        void setPropertyDouble​(String key,
                               Double value)
      • getPropertyString

        String getPropertyString​(String key)
      • setPropertyString

        void setPropertyString​(String key,
                               String value)
      • getPropertyColor

        Color getPropertyColor​(String key)
      • setPropertyColor

        void setPropertyColor​(String key,
                              Color newValue)
      • getPropertyFont

        Font getPropertyFont​(String key)
      • getPropertyFont

        Font getPropertyFont​(String key,
                             Font defaultValue)
      • setPropertyFont

        void setPropertyFont​(String key,
                             Font font)