org.scijava.prefs
Class DefaultPrefService

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.service.AbstractService
              extended by org.scijava.prefs.AbstractPrefService
                  extended by org.scijava.prefs.DefaultPrefService
All Implemented Interfaces:
Comparable<Prioritized>, Contextual, Disposable, HasPluginInfo, RichPlugin, SciJavaPlugin, PrefService, Prioritized, SciJavaService, Service

public class DefaultPrefService
extends AbstractPrefService

Default PrefService implementation, which persists preferences to disk using the Java Preferences API.

Author:
Mark Hiner

Constructor Summary
DefaultPrefService()
           
 
Method Summary
 void clear(Class<?> c)
           
 void clear(Class<?> prefClass, String key)
          Clears the node indexed under the given class.
 void clear(String key)
          Clears the node.
 void clear(String absolutePath, String key)
          Clears the ndoe indexed under the given path.
 void clearAll()
          Clears everything.
 String get(Class<?> c, String name)
           
 String get(Class<?> c, String name, String defaultValue)
           
 String get(String name)
           
 String get(String name, String defaultValue)
           
 boolean getBoolean(Class<?> c, String name, boolean defaultValue)
           
 boolean getBoolean(String name, boolean defaultValue)
           
 double getDouble(Class<?> c, String name, double defaultValue)
           
 double getDouble(String name, double defaultValue)
           
 float getFloat(Class<?> c, String name, float defaultValue)
           
 float getFloat(String name, float defaultValue)
           
 int getInt(Class<?> c, String name, int defaultValue)
           
 int getInt(String name, int defaultValue)
           
 Iterable<String> getIterable(Class<?> prefClass, String key)
          Gets an iterable from the preferences.
 Iterable<String> getIterable(String key)
          Gets an iterable from the preferences.
 List<String> getList(Class<?> prefClass)
          Gets a List from the preferences.
 List<String> getList(Class<?> prefClass, String key)
          Gets a List from the preferences, indexed under the specified class.
 List<String> getList(String key)
          Gets a List from the preferences.
 List<String> getList(String absolutePath, String key)
          Gets a List from the preferences, indexed under the specified path.
 long getLong(Class<?> c, String name, long defaultValue)
           
 long getLong(String name, long defaultValue)
           
 Map<String,String> getMap(Class<?> prefClass)
          Gets a Map from the preferences.
 Map<String,String> getMap(Class<?> prefClass, String key)
          Gets a map from the preferences, indexed under the specified class.
 Map<String,String> getMap(String key)
          Gets a Map from the preferences.
 Map<String,String> getMap(String absolutePath, String key)
           
 void put(Class<?> c, String name, boolean value)
           
 void put(Class<?> c, String name, double value)
           
 void put(Class<?> c, String name, float value)
           
 void put(Class<?> c, String name, int value)
           
 void put(Class<?> c, String name, long value)
           
 void put(Class<?> c, String name, String value)
           
 void put(String name, boolean value)
           
 void put(String name, double value)
           
 void put(String name, float value)
           
 void put(String name, int value)
           
 void put(String name, long value)
           
 void put(String name, String value)
           
 void putIterable(Class<?> prefClass, Iterable<String> iterable, String key)
          Puts an iterable into the preferences.
 void putIterable(Iterable<String> iterable, String key)
          Puts an iterable into the preferences.
 void putList(Class<?> prefClass, List<String> list)
          Puts a list into the preferences.
 void putList(Class<?> prefClass, List<String> list, String key)
          Puts a list into the preferences, indexed under the specified class.
 void putList(List<String> list, String key)
          Puts a list into the preferences.
 void putList(String absolutePath, List<String> list)
          Puts a list into the preferences, indexed under the specified path.
 void putList(String absolutePath, List<String> list, String key)
          Puts a list into the preferences, indexed under the specified path and relative key.
 void putMap(Class<?> prefClass, Map<String,String> map)
          Puts a Map into the preferences, indexed under the given class.
 void putMap(Class<?> prefClass, Map<String,String> map, String key)
          Puts a Map into the preferences, indexed under the specified class.
 void putMap(Map<String,String> map, String key)
          Puts a Map into the preferences.
 void putMap(String absolutePath, Map<String,String> map)
          Puts a Map into the preferences, indexed under the given path.
 void putMap(String absolutePath, Map<String,String> map, String key)
          Puts a Map into the preferences, indexed under the given path and relative key path.
 void remove(Class<?> prefClass, String key)
          Removes the node.
 void remove(String absolutePath, String key)
           
 
Methods inherited from class org.scijava.prefs.AbstractPrefService
initialize
 
Methods inherited from class org.scijava.service.AbstractService
dispose, getContext, registerEventHandlers, setContext, toString
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority
 
Methods inherited from class org.scijava.AbstractContextual
context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Disposable
dispose
 

Constructor Detail

DefaultPrefService

public DefaultPrefService()
Method Detail

get

public String get(String name)

get

public String get(String name,
                  String defaultValue)

getBoolean

public boolean getBoolean(String name,
                          boolean defaultValue)

getDouble

public double getDouble(String name,
                        double defaultValue)

getFloat

public float getFloat(String name,
                      float defaultValue)

getInt

public int getInt(String name,
                  int defaultValue)

getLong

public long getLong(String name,
                    long defaultValue)

put

public void put(String name,
                String value)

put

public void put(String name,
                boolean value)

put

public void put(String name,
                double value)

put

public void put(String name,
                float value)

put

public void put(String name,
                int value)

put

public void put(String name,
                long value)

get

public String get(Class<?> c,
                  String name)

get

public String get(Class<?> c,
                  String name,
                  String defaultValue)

getBoolean

public boolean getBoolean(Class<?> c,
                          String name,
                          boolean defaultValue)

getDouble

public double getDouble(Class<?> c,
                        String name,
                        double defaultValue)

getFloat

public float getFloat(Class<?> c,
                      String name,
                      float defaultValue)

getInt

public int getInt(Class<?> c,
                  String name,
                  int defaultValue)

getLong

public long getLong(Class<?> c,
                    String name,
                    long defaultValue)

put

public void put(Class<?> c,
                String name,
                String value)

put

public void put(Class<?> c,
                String name,
                boolean value)

put

public void put(Class<?> c,
                String name,
                double value)

put

public void put(Class<?> c,
                String name,
                float value)

put

public void put(Class<?> c,
                String name,
                int value)

put

public void put(Class<?> c,
                String name,
                long value)

clear

public void clear(Class<?> c)

clearAll

public void clearAll()
Description copied from interface: PrefService
Clears everything.


clear

public void clear(String key)
Description copied from interface: PrefService
Clears the node.


clear

public void clear(Class<?> prefClass,
                  String key)
Description copied from interface: PrefService
Clears the node indexed under the given class.


clear

public void clear(String absolutePath,
                  String key)
Description copied from interface: PrefService
Clears the ndoe indexed under the given path.


remove

public void remove(Class<?> prefClass,
                   String key)
Description copied from interface: PrefService
Removes the node.


remove

public void remove(String absolutePath,
                   String key)

putMap

public void putMap(Map<String,String> map,
                   String key)
Description copied from interface: PrefService
Puts a Map into the preferences.


putMap

public void putMap(Class<?> prefClass,
                   Map<String,String> map,
                   String key)
Description copied from interface: PrefService
Puts a Map into the preferences, indexed under the specified class.


putMap

public void putMap(String absolutePath,
                   Map<String,String> map,
                   String key)
Description copied from interface: PrefService
Puts a Map into the preferences, indexed under the given path and relative key path.


putMap

public void putMap(Class<?> prefClass,
                   Map<String,String> map)
Description copied from interface: PrefService
Puts a Map into the preferences, indexed under the given class.


putMap

public void putMap(String absolutePath,
                   Map<String,String> map)
Description copied from interface: PrefService
Puts a Map into the preferences, indexed under the given path.


getMap

public Map<String,String> getMap(String key)
Description copied from interface: PrefService
Gets a Map from the preferences.


getMap

public Map<String,String> getMap(Class<?> prefClass,
                                 String key)
Description copied from interface: PrefService
Gets a map from the preferences, indexed under the specified class.


getMap

public Map<String,String> getMap(String absolutePath,
                                 String key)

getMap

public Map<String,String> getMap(Class<?> prefClass)
Description copied from interface: PrefService
Gets a Map from the preferences.


putList

public void putList(List<String> list,
                    String key)
Description copied from interface: PrefService
Puts a list into the preferences.


putList

public void putList(Class<?> prefClass,
                    List<String> list,
                    String key)
Description copied from interface: PrefService
Puts a list into the preferences, indexed under the specified class.


putList

public void putList(String absolutePath,
                    List<String> list,
                    String key)
Description copied from interface: PrefService
Puts a list into the preferences, indexed under the specified path and relative key.


putList

public void putList(Class<?> prefClass,
                    List<String> list)
Description copied from interface: PrefService
Puts a list into the preferences.


putList

public void putList(String absolutePath,
                    List<String> list)
Description copied from interface: PrefService
Puts a list into the preferences, indexed under the specified path.


getList

public List<String> getList(String key)
Description copied from interface: PrefService
Gets a List from the preferences.


getList

public List<String> getList(Class<?> prefClass,
                            String key)
Description copied from interface: PrefService
Gets a List from the preferences, indexed under the specified class.


getList

public List<String> getList(String absolutePath,
                            String key)
Description copied from interface: PrefService
Gets a List from the preferences, indexed under the specified path.


getList

public List<String> getList(Class<?> prefClass)
Description copied from interface: PrefService
Gets a List from the preferences. Returns an empty list if nothing in prefs.


getIterable

public Iterable<String> getIterable(String key)
Description copied from interface: PrefService
Gets an iterable from the preferences.


getIterable

public Iterable<String> getIterable(Class<?> prefClass,
                                    String key)
Description copied from interface: PrefService
Gets an iterable from the preferences.


putIterable

public void putIterable(Iterable<String> iterable,
                        String key)
Description copied from interface: PrefService
Puts an iterable into the preferences.


putIterable

public void putIterable(Class<?> prefClass,
                        Iterable<String> iterable,
                        String key)
Description copied from interface: PrefService
Puts an iterable into the preferences.



Copyright © 2009–2014 SciJava. All rights reserved.