ecologylab.appframework.types
Class Preference

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.xml.ElementState
          extended by ecologylab.xml.types.element.ArrayListState
              extended by ecologylab.appframework.types.Preference
All Implemented Interfaces:
OptimizationTypes, XMLTranslationExceptionTypes, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List

Deprecated.

@Deprecated
public class Preference
extends ArrayListState

Represents a preference in the form of name/val. Can also hold a tree of ElementState objects of any type! that is, one or more.

Author:
blake, andruid

Nested Class Summary
 
Nested classes/interfaces inherited from class ecologylab.xml.ElementState
ElementState.ClassToCollectionMap, ElementState.DeclarationStyle, ElementState.xml_attribute, ElementState.xml_class, ElementState.xml_classes, ElementState.xml_collection, ElementState.xml_leaf, ElementState.xml_map, ElementState.xml_nested, ElementState.xml_tag
 
Field Summary
protected  java.lang.String name
          Deprecated.  
protected  java.lang.String value
          Deprecated.  
 
Fields inherited from class ecologylab.xml.types.element.ArrayListState
set
 
Fields inherited from class ecologylab.xml.ElementState
CDATA, ESTIMATE_CHARS_PER_FIELD, FLOATING_PRECISION_OFF, MARSHALLING_PARAMS, NORMAL, UTF16, UTF16_LE, UTF8, XML_FILE_HEADER
 
Fields inherited from interface ecologylab.xml.OptimizationTypes
BAD_FIELD, COLLECTION_ELEMENT, COLLECTION_SCALAR, IGNORED_ATTRIBUTE, IGNORED_ELEMENT, LEAF_NODE_VALUE, MAP_ELEMENT, MAP_SCALAR, NAME_SPACE_ATTRIBUTE, NAME_SPACE_LEAF_NODE, NAME_SPACE_MASK, NAME_SPACE_NESTED_ELEMENT, NAMESPACE_IGNORED_ELEMENT, NAMESPACE_TRIAL_ELEMENT, OTHER_NESTED_ELEMENT, REGULAR_ATTRIBUTE, REGULAR_NESTED_ELEMENT, ROOT, UNSET_TYPE, XMLNS_ATTRIBUTE, XMLNS_IGNORED
 
Fields inherited from interface ecologylab.xml.XMLTranslationExceptionTypes
FILE_NOT_FOUND, IO_EXCEPTION, NULL_PURL, UNKNOWN
 
Constructor Summary
Preference()
          Deprecated.  
Preference(java.lang.String name, java.lang.String value)
          Deprecated.  
 
Method Summary
 ElementState child()
          Deprecated. Natural accessor when you have a single ElementState child in your preference.
 java.lang.String getName()
          Deprecated. Access the name of this Preference.
 java.lang.String getValue()
          Deprecated. Access the value of this Preference.
static Preference lookup(java.lang.String name)
          Deprecated. Get a full Preference object entry from the registry.
static boolean lookupBoolean(java.lang.String name)
          Deprecated. Get a boolean parameter from the Environment.
static boolean lookupBoolean(java.lang.String name, boolean defaultValue)
          Deprecated. Get a boolean parameter from the Environment.
static java.awt.Color lookupColor(java.lang.String param)
          Deprecated. Look-up a preference which is translated into a Color.
static float lookupFloat(java.lang.String paramName, float defaultValue)
          Deprecated. Get a float parameter from the Environment.
static int lookupInt(java.lang.String paramName)
          Deprecated. Get an integer from the Environment.
static int lookupInt(java.lang.String paramName, int defaultValue)
          Deprecated. Get an integer parameter from the Environment.
static java.lang.String lookupString(java.lang.String name)
          Deprecated. Get an entry from the registry, with value type String.
static java.lang.String lookupString(java.lang.String name, java.lang.String defaultValue)
          Deprecated. Get an entry from the registry, with value type String.
protected static Scope preferencesRegistry()
          Deprecated. The default ObjectRegistry that preferences are stored in for the current application's Environment.
 void register()
          Deprecated. Register this into the Environment's default preferencesRegistry.
 void register(Scope preferencesRegistry)
          Deprecated. Register this into a PreferencesRegistry.
static void register(java.lang.String name, java.lang.String value)
          Deprecated.  
 void setName(java.lang.String name)
          Deprecated. Set the name of this Preference.
 void setValue(java.lang.String value)
          Deprecated. Set the value of this Preference.
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class ecologylab.xml.types.element.ArrayListState
add, add, addAll, addAll, clear, clone, contains, containsAll, get, getArrayList, getCollection, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, recycle, remove, remove, removeAll, retainAll, set, set, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class ecologylab.xml.ElementState
addNestedElement, addNestedElement, appendTextNodeString, buildDOM, buildDOM, buildDOM, buildDOM, buildDOM, buildDOMFromXMLCharSequence, buildDOMFromXMLString, checkAnnotation, convertNameStyles, createChildHook, fieldToXMLOptimizations, floatingPrecision, getElementStateById, getMap, getNestedNameSpace, getTextNodeString, leafElementFieldNames, lookupNestedNameSpace, optimizations, parent, postTranslationProcessingHook, preTranslationProcessingHook, setDeclarationStyle, setFieldUsingTypeRegistry, setFloatingPrecision, setParent, setUseDOMForTranslateTo, translateFromXML, translateFromXML, translateFromXML, translateFromXML, translateFromXML, translateFromXMLCharSequence, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOM, translateFromXMLDOMCharSequence, translateFromXMLDOMCharSequence, translateFromXMLRootNode, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateFromXMLSAX, translateToDOM, translateToXML, translateToXML, translateToXML, translateToXML, writePrettyXML, writePrettyXML, writePrettyXML
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Field Detail

name

protected java.lang.String name
Deprecated. 

value

protected java.lang.String value
Deprecated. 
Constructor Detail

Preference

public Preference()
Deprecated. 

Preference

public Preference(java.lang.String name,
                  java.lang.String value)
Deprecated. 
Method Detail

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class Debug

child

public ElementState child()
Deprecated. 
Natural accessor when you have a single ElementState child in your preference.

Returns:
Returns the first child in the set.

getName

public java.lang.String getName()
Deprecated. 
Access the name of this Preference.

Returns:
The Preference's name.

getValue

public java.lang.String getValue()
Deprecated. 
Access the value of this Preference.

Returns:
The Preference's value.

setName

public void setName(java.lang.String name)
Deprecated. 
Set the name of this Preference.

Parameters:
name -

setValue

public void setValue(java.lang.String value)
Deprecated. 
Set the value of this Preference.

Parameters:
value -

preferencesRegistry

protected static Scope preferencesRegistry()
Deprecated. 
The default ObjectRegistry that preferences are stored in for the current application's Environment.

Returns:
ObjectRegistry that Preferences are stored in

register

public void register()
Deprecated. 
Register this into the Environment's default preferencesRegistry.


register

public static void register(java.lang.String name,
                            java.lang.String value)
Deprecated. 

register

public void register(Scope preferencesRegistry)
Deprecated. 
Register this into a PreferencesRegistry.

Parameters:
preferencesRegistry -

lookup

public static Preference lookup(java.lang.String name)
Deprecated. 
Get a full Preference object entry from the registry.

Parameters:
name - The name of the preference.
Returns:
The corresponding Preference object.

lookupString

public static java.lang.String lookupString(java.lang.String name,
                                            java.lang.String defaultValue)
Deprecated. 
Get an entry from the registry, with value type String.

Parameters:
name - Key to use to lookup the Preference.
defaultValue - Default value to return if the Preference is not found in the registry.
Returns:
String value.

lookupString

public static java.lang.String lookupString(java.lang.String name)
Deprecated. 
Get an entry from the registry, with value type String.

Parameters:
name - Key to use to lookup the Preference.
Returns:
String value, or null if the preferences registry contains no value for this key..

lookupBoolean

public static boolean lookupBoolean(java.lang.String name)
Deprecated. 
Get a boolean parameter from the Environment. Environment is an interface that enables consistent runtime preferences to be passed into code from diverse circumstances, such as applets, applications, and servlets.

If the value is the string true or yes, the result is true; else false.

Parameters:
name - The name of the parameter's key.

lookupBoolean

public static boolean lookupBoolean(java.lang.String name,
                                    boolean defaultValue)
Deprecated. 
Get a boolean parameter from the Environment. Environment is an interface that enables consistent runtime preferences to be passed into code from diverse circumstances, such as applets, applications, and servlets.

If the value is the string true or yes, the result is true; else false.

Parameters:
name -
defaultValue -
Returns:
The boolean tranlated from the preference in the Environment, or the defaultValue if no such preference was found.

lookupInt

public static int lookupInt(java.lang.String paramName)
Deprecated. 
Get an integer from the Environment. Environment is an interface that enables consistent runtime preferences to be passed into code from diverse circumstances, such as applets, applications, and servlets.

The default is 0.

Parameters:
paramName - The name of the parameter's key.

lookupInt

public static int lookupInt(java.lang.String paramName,
                            int defaultValue)
Deprecated. 
Get an integer parameter from the Environment. Environment is an interface that enables consistent runtime preferences to be passed into code from diverse circumstances, such as applets, applications, and servlets.

Parameters:
paramName - The name of the parameter's key.
defaultValue - Default integer value, in case param is unspecified in the runtime env.

lookupFloat

public static float lookupFloat(java.lang.String paramName,
                                float defaultValue)
Deprecated. 
Get a float parameter from the Environment. Environment is an interface that enables consistent runtime preferences to be passed into code from diverse circumstances, such as applets, applications, and servlets.

Parameters:
paramName - The name of the parameter's key.
defaultValue - Default floating point value, in case param is unspecified in the runtime env.
Returns:
The float tranlated from the preference in the Environment, or the defaultValue if no such preference was found.

lookupColor

public static java.awt.Color lookupColor(java.lang.String param)
Deprecated. 
Look-up a preference which is translated into a Color.

Parameters:
param -
Returns:
The translated Color preference, or Color.white if the Preference is not found.