org.scijava.prefs
Interface PrefService

All Superinterfaces:
Comparable<Prioritized>, Contextual, Disposable, HasPluginInfo, Prioritized, RichPlugin, SciJavaPlugin, SciJavaService, Service
All Known Implementing Classes:
AbstractPrefService, DefaultPrefService

public interface PrefService
extends SciJavaService

Service for storing and retrieving arbitrary preferences.

Author:
Mark Hiner

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 interface org.scijava.service.Service
initialize, 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
 

Method Detail

get

String get(String name)

get

String get(String name,
           String defaultValue)

getBoolean

boolean getBoolean(String name,
                   boolean defaultValue)

getDouble

double getDouble(String name,
                 double defaultValue)

getFloat

float getFloat(String name,
               float defaultValue)

getInt

int getInt(String name,
           int defaultValue)

getLong

long getLong(String name,
             long defaultValue)

put

void put(String name,
         String value)

put

void put(String name,
         boolean value)

put

void put(String name,
         double value)

put

void put(String name,
         float value)

put

void put(String name,
         int value)

put

void put(String name,
         long value)

get

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

get

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

getBoolean

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

getDouble

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

getFloat

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

getInt

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

getLong

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

put

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

put

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

put

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

put

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

put

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

put

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

clear

void clear(Class<?> c)

clearAll

void clearAll()
Clears everything.


clear

void clear(String key)
Clears the node.


clear

void clear(Class<?> prefClass,
           String key)
Clears the node indexed under the given class.


clear

void clear(String absolutePath,
           String key)
Clears the ndoe indexed under the given path.


remove

void remove(Class<?> prefClass,
            String key)
Removes the node.


remove

void remove(String absolutePath,
            String key)

putMap

void putMap(Map<String,String> map,
            String key)
Puts a Map into the preferences.


putMap

void putMap(Class<?> prefClass,
            Map<String,String> map,
            String key)
Puts a Map into the preferences, indexed under the specified class.


putMap

void putMap(String absolutePath,
            Map<String,String> map)
Puts a Map into the preferences, indexed under the given path.


putMap

void putMap(Class<?> prefClass,
            Map<String,String> map)
Puts a Map into the preferences, indexed under the given class.


putMap

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.


getMap

Map<String,String> getMap(String key)
Gets a Map from the preferences.


getMap

Map<String,String> getMap(Class<?> prefClass,
                          String key)
Gets a map from the preferences, indexed under the specified class.


getMap

Map<String,String> getMap(Class<?> prefClass)
Gets a Map from the preferences.


getMap

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

putList

void putList(List<String> list,
             String key)
Puts a list into the preferences.


putList

void putList(Class<?> prefClass,
             List<String> list,
             String key)
Puts a list into the preferences, indexed under the specified class.


putList

void putList(String absolutePath,
             List<String> list,
             String key)
Puts a list into the preferences, indexed under the specified path and relative key.


putList

void putList(Class<?> prefClass,
             List<String> list)
Puts a list into the preferences.


putList

void putList(String absolutePath,
             List<String> list)
Puts a list into the preferences, indexed under the specified path.


getList

List<String> getList(String key)
Gets a List from the preferences.


getList

List<String> getList(String absolutePath,
                     String key)
Gets a List from the preferences, indexed under the specified path.


getList

List<String> getList(Class<?> prefClass,
                     String key)
Gets a List from the preferences, indexed under the specified class.


getList

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


putIterable

void putIterable(Iterable<String> iterable,
                 String key)
Puts an iterable into the preferences.


putIterable

void putIterable(Class<?> prefClass,
                 Iterable<String> iterable,
                 String key)
Puts an iterable into the preferences.


getIterable

Iterable<String> getIterable(String key)
Gets an iterable from the preferences.


getIterable

Iterable<String> getIterable(Class<?> prefClass,
                             String key)
Gets an iterable from the preferences.



Copyright © 2009–2014 SciJava. All rights reserved.