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

## tapeutils.zx81
Class Preferences

    java.lang.Object
      tapeutils.zx81.Preferences

public class Preferences
extends java.lang.Object

This class provides a set of preferences with update events.

Author:
  hldswrth

Constructor Summary
`Preferences(java.lang.String fileName, java.lang.String fileHeader)` Constructor.

Method Summary
`void` | `addPreferenceListener(PreferenceListener l)` Register the given listener for preference events.
`void` | `firePreferenceUpdateEvent(java.lang.Object source, java.lang.String key)` Fire a preference update event.
`boolean` | `get(java.lang.String key, boolean defaultValue)` Get the preference value as a boolean value.
`java.io.File` | `get(java.lang.String key, java.io.File defaultValue)` Get the preference value as a File.
`float` | `get(java.lang.String key, float defaultValue)` Get the preference value as a floating point value.
`int` | `get(java.lang.String key, int defaultValue)` Get the preference value as an integer value.
`java.lang.String` | `get(java.lang.String key, java.lang.String defaultValue)` Get the preference value with the given default.
`void` | `removePreferenceListener(PreferenceListener l)` Deregister the given listener for preference events.
`void` | `save(boolean force)` Save the preferences.
`void` | `set(java.lang.Object source, java.lang.String key, boolean value)` Set the preference value.
`void` | `set(java.lang.Object source, java.lang.String key, float value)` Set the preference value.
`void` | `set(java.lang.Object source, java.lang.String key, int value)` Set the preference value.
`boolean` | `set(java.lang.Object source, java.lang.String key, java.lang.String value)` Set the preference value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Preferences

    public Preferences(java.lang.String fileName,
                       java.lang.String fileHeader)
                throws java.io.IOException

  Constructor.

Parameters:
  `fileName` -
  `fileHeader` -
Throws:
  `java.io.IOException`

Method Detail

### get

    public java.lang.String get(java.lang.String key,
                                java.lang.String defaultValue)

  Get the preference value with the given default.

  Parameters:
    `key` - The key for the value.
    `defaultValue` - The default value.
  Returns:
    The value.

### get

    public boolean get(java.lang.String key,
                       boolean defaultValue)

  Get the preference value as a boolean value.

  Parameters:
    `key` - The key for the value.
    `defaultValue` - The default value.
  Returns:
    The value.

### get

    public int get(java.lang.String key,
                   int defaultValue)

  Get the preference value as an integer value.

  Parameters:
    `key` - The key for the value.
    `defaultValue` - The default value.
  Returns:
    The value.

### get

    public float get(java.lang.String key,
                     float defaultValue)

  Get the preference value as a floating point value.

  Parameters:
    `key` - The key for the value.
    `defaultValue` - The default value.
  Returns:
    The value.

### get

    public java.io.File get(java.lang.String key,
                            java.io.File defaultValue)

  Get the preference value as a File.

  Parameters:
    `key` - The key for the value.
    `defaultValue` - The default value.
  Returns:
    The value.

### set

    public boolean set(java.lang.Object source,
                       java.lang.String key,
                       java.lang.String value)

  Set the preference value.

  Parameters:
    `source` - The source of the update.
    `key` - The key for the value.
    `value` - The value.
  Returns:
    Indicates whether the update was successful.

### set

    public void set(java.lang.Object source,
                    java.lang.String key,
                    boolean value)

  Set the preference value.

  Parameters:
    `source` - The source of the update.
    `key` - The key for the value.
    `value` - The value.

### set

    public void set(java.lang.Object source,
                    java.lang.String key,
                    int value)

  Set the preference value.

  Parameters:
    `source` - The source of the update.
    `key` - The key for the value.
    `value` - The value.

### set

    public void set(java.lang.Object source,
                    java.lang.String key,
                    float value)

  Set the preference value.

  Parameters:
    `source` - The source of the update.
    `key` - The key for the value.
    `value` - The value.

### save

    public void save(boolean force)
              throws java.io.IOException

  Save the preferences.

  Parameters:
    `force` - Indicates whether to force a save.
  Throws:
    `java.io.IOException`

### addPreferenceListener

    public void addPreferenceListener(PreferenceListener l)

  Register the given listener for preference events.

  Parameters:
    `l` - The listener.

### removePreferenceListener

    public void removePreferenceListener(PreferenceListener l)

  Deregister the given listener for preference events.

  Parameters:
    `l` - The listener.

### firePreferenceUpdateEvent

    public void firePreferenceUpdateEvent(java.lang.Object source,
                                          java.lang.String key)

  Fire a preference update event.

  Parameters:
    `source` - The source of the event.
    `key` - The preference key.

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