Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.caff.maze
Interface DataStorage

All Known Subinterfaces:
  SystemAccess

All Known Implementing Classes:
  ApplicationSystemAccess, FileDataStorage, JnlpSystemAccess, NullSystemAccess, TemporaryDataStorage

    public interface DataStorage

An interface for temporary or persistent storage of data.

Method Summary
`boolean` | `getBoolean(java.lang.String key, boolean defaultValue)` Get a boolean value.
`java.awt.Color` | `getColor(java.lang.String key, java.awt.Color defaultValue)` Get a color value.
`double` | `getDouble(java.lang.String key, double defaultValue)` Get a double value.
`int` | `getInt(java.lang.String key, int defaultValue)` Get a integer value.
`long` | `getLong(java.lang.String key, long defaultValue)` Get a persistent long integer value.
`java.lang.String` | `getString(java.lang.String key, java.lang.String defaultValue)` Get a string value.
`boolean` | `hasKey(java.lang.String key)` Is his key defined?
`void` | `setBoolean(java.lang.String key, boolean value)` Set a boolean.
`void` | `setColor(java.lang.String key, java.awt.Color value)` Set a color.
`void` | `setDouble(java.lang.String key, double value)` Set a double value.
`void` | `setInt(java.lang.String key, int value)` Set a integer value.
`void` | `setLong(java.lang.String key, long value)` Set a long integer value.
`void` | `setString(java.lang.String key, java.lang.String value)` Set a string.
`void` | `storePersistentData()` Store all data if this has not already happenend.

Method Detail

### getString

    java.lang.String getString(java.lang.String key,
                               java.lang.String defaultValue)

  Get a string value.

  Parameters:
    `key` - key for the string
    `defaultValue` - default value which is returned if the string is not defined
  Returns:
    the string value defined by the key or the default value

### setString

    void setString(java.lang.String key,
                   java.lang.String value)

  Set a string.

  Parameters:
    `key` - key for the string
    `value` - the string value to store

### getBoolean

    boolean getBoolean(java.lang.String key,
                       boolean defaultValue)

  Get a boolean value.

  Parameters:
    `key` - the key of the value
    `defaultValue` - the default value if the key is not defined
  Returns:
    the boolean value defined by the key of the default value

### setBoolean

    void setBoolean(java.lang.String key,
                    boolean value)

  Set a boolean.

  Parameters:
    `key` - key for the boolean
    `value` - value of the boolean

### getInt

    int getInt(java.lang.String key,
               int defaultValue)

  Get a integer value.

  Parameters:
    `key` - the key of the value
    `defaultValue` - the default value if the key is not defined
  Returns:
    the integer value defined by the key of the default value

### setInt

    void setInt(java.lang.String key,
                int value)

  Set a integer value.

  Parameters:
    `key` - key for the int
    `value` - value of the int

### getLong

    long getLong(java.lang.String key,
                 long defaultValue)

  Get a persistent long integer value.

  Parameters:
    `key` - the key of the value
    `defaultValue` - the default value if the key is not defined
  Returns:
    the long integer value defined by the key of the default value

### setLong

    void setLong(java.lang.String key,
                 long value)

  Set a long integer value.

  Parameters:
    `key` - key for the long int
    `value` - value of the long int

### getDouble

    double getDouble(java.lang.String key,
                     double defaultValue)

  Get a double value.

  Parameters:
    `key` - the key of the value
    `defaultValue` - the default value if the key is not defined
  Returns:
    the double value defined by the key of the default value

### setDouble

    void setDouble(java.lang.String key,
                   double value)

  Set a double value.

  Parameters:
    `key` - key for the int
    `value` - value of the int

### getColor

    java.awt.Color getColor(java.lang.String key,
                            java.awt.Color defaultValue)

  Get a color value.

  Parameters:
    `key` - the key of the value
    `defaultValue` - the default value if the key is not defined
  Returns:
    the color value deg´fined by the key of the default value

### setColor

    void setColor(java.lang.String key,
                  java.awt.Color value)

  Set a color.

  Parameters:
    `key` - key for the color
    `value` - value of the color

### hasKey

    boolean hasKey(java.lang.String key)

  Is his key defined?

  Parameters:
    `key` - key to look for
  Returns:
    `true` if the key is defined, `false` otherwise

### storePersistentData

    void storePersistentData()

  Store all data if this has not already happenend. This is called when the process is about to shutdown. On it persistent implementation of this interface this method should store all data persistently if this has not already happened. A temporary storage does nothing.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD