de.esprit.common.util

## Class PropertyMap

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<K,V>
    - - java.util.LinkedHashMap<K,V>
      - - de.esprit.common.util.PowerMap<java.lang.String,java.lang.Object>
        - - de.esprit.common.util.PropertyMap

- All Implemented Interfaces:
    Dumpable, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>
  Direct Known Subclasses:
    EnvMap, FileParams

      public class PropertyMap
      extends PowerMap<java.lang.String,java.lang.Object>

  This class stores property key-value pairs and keeps the order of it's entries! Keys must be Strings and the Object values should have a reasonable String representation - thus they can be saved to and loaded from a property file. Furthermore there are convenience methods for getting out a property as a particular data-type like int, double, Color etc.

  Note that this class does not allow to store nulls neither as keys nor as values. Keys are unique. If a key is added twice it will be replaced. If a null value is attempted to be stored for an existing key then the key is being removed from the map.

  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.util.AbstractMap

      `java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PropertyMap()`
    `PropertyMap(int initialCapacity)`
    `PropertyMap(int initialCapacity, float loadFactor)`
    `PropertyMap(int initialCapacity, float loadFactor, boolean accessOrder)`
    `PropertyMap(java.util.Map<java.lang.String,java.lang.Object> map)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PropertyMap` | `clone()`
    `int` | `loadFrom(java.io.File file)`
    `int` | `loadFrom(java.io.InputStream in)`
    `void` | `saveTo(java.io.BufferedWriter writer, java.util.List<java.lang.String> headLines)`
    `void` | `saveTo(java.io.File file)`
    `void` | `saveTo(java.io.File file, java.util.List<java.lang.String> headLines)`

    - ### Methods inherited from class de.esprit.common.util.PowerMap

      `createDumpHeader, getAsBoolean, getAsBoolean, getAsDate, getAsDate, getAsDouble, getAsDouble, getAsDuration, getAsDuration, getAsFloat, getAsFloat, getAsInt, getAsInt, getAsLong, getAsLong, getAsShort, getAsShort, getAsString, getAsString, getAsTime, getAsTime, getAsTimestamp, getAsTimestamp, getMaxKeyLength, reverse, toDumpString, toDumpString, toString, toString`

    - ### Methods inherited from class java.util.LinkedHashMap

      `clear, containsValue, get, removeEldestEntry`

    - ### Methods inherited from class java.util.HashMap

      `containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values`

    - ### Methods inherited from class java.util.AbstractMap

      `equals, hashCode`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values`

- - ### Constructor Detail

    - #### PropertyMap

          public PropertyMap()

    - #### PropertyMap

          public PropertyMap(int initialCapacity,
                     float loadFactor,
                     boolean accessOrder)

    - #### PropertyMap

          public PropertyMap(int initialCapacity,
                     float loadFactor)

    - #### PropertyMap

          public PropertyMap(int initialCapacity)

    - #### PropertyMap

          public PropertyMap(java.util.Map<java.lang.String,java.lang.Object> map)

  - ### Method Detail

    - #### loadFrom

          public int loadFrom(java.io.InputStream in)
                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### loadFrom

          public int loadFrom(java.io.File file)
                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### saveTo

          public void saveTo(java.io.File file)
                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### saveTo

          public void saveTo(java.io.File file,
                    java.util.List<java.lang.String> headLines)
                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### saveTo

          public void saveTo(java.io.BufferedWriter writer,
                    java.util.List<java.lang.String> headLines)
                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### clone

          public PropertyMap clone()

      Overrides:
        `clone` in class `java.util.HashMap<java.lang.String,java.lang.Object>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.