ecologylab.appframework.types.prefs
Class MetaPrefSet

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

public class MetaPrefSet
extends ArrayListState<MetaPref>

Groupings of MetaPrefs, by category. Categories are also ordered in a separate ArrayList. Contains functions related to adding MetaPrefs to the grouping, getting MetaPrefs, getting the categories, etc.

Author:
Cae

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
 
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
MetaPrefSet()
           
 
Method Summary
 boolean add(MetaPref metaPref)
          Register the MetaPref in the static global map, as well as adding it to the super ArrayListState.
protected  void createChildHook(ElementState child)
          Perform custom processing on the newly created child node, just before it is added to this.
 java.util.Set<java.lang.String> getCategories()
          Get the category names in a Set of Strings.
 int getHeight()
           
 java.util.ArrayList<MetaPref> getMetaPrefListByCategory(java.lang.String cat)
          Get the MetaPref ArrayList for a category name.
 int getNumberOfTabs()
          Return the number of categories.
 java.lang.String[] getOrderedTabNames(java.lang.String[] tabList)
          Return the ordered list of categories.
 java.lang.String getTitle()
           
 int getWidth()
           
static MetaPrefSet load(java.io.File file, TranslationSpace translationSpace)
          Read MetaPref declarations from a file or across the net.
static MetaPrefSet load(ParsedURL purl, TranslationSpace translationSpace)
          Read MetaPref declarations from a file or across the net.
 
Methods inherited from class ecologylab.xml.types.element.ArrayListState
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, 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, 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
 

Constructor Detail

MetaPrefSet

public MetaPrefSet()
Method Detail

createChildHook

protected void createChildHook(ElementState child)
Perform custom processing on the newly created child node, just before it is added to this.

This is part of depth-first traversal during translateFromXML().

Add the entry to the category map.

Also, create a Pref to match the MetaPref child, if there isn't one already.

Overrides:
createChildHook in class ElementState
Parameters:
child -

getOrderedTabNames

public java.lang.String[] getOrderedTabNames(java.lang.String[] tabList)
Return the ordered list of categories.

Parameters:
tabList - String Array that will hold category names.
Returns:
tabList String Array that will hold category names.

getNumberOfTabs

public int getNumberOfTabs()
Return the number of categories.

Returns:
Number of categories

getCategories

public java.util.Set<java.lang.String> getCategories()
Get the category names in a Set of Strings.

Returns:
String Set of categories.

getMetaPrefListByCategory

public java.util.ArrayList<MetaPref> getMetaPrefListByCategory(java.lang.String cat)
Get the MetaPref ArrayList for a category name.

Parameters:
cat - Name of category
Returns:
ArrayList of MetaPrefs

add

public boolean add(MetaPref metaPref)
Register the MetaPref in the static global map, as well as adding it to the super ArrayListState.

Specified by:
add in interface java.util.Collection<MetaPref>
Specified by:
add in interface java.util.List<MetaPref>
Overrides:
add in class ArrayListState<MetaPref>
Parameters:
metaPref -
Returns:

load

public static MetaPrefSet load(java.io.File file,
                               TranslationSpace translationSpace)
                        throws XMLTranslationException
Read MetaPref declarations from a file or across the net.

Parameters:
file -
translationSpace -
Returns:
Throws:
XMLTranslationException

load

public static MetaPrefSet load(ParsedURL purl,
                               TranslationSpace translationSpace)
                        throws XMLTranslationException
Read MetaPref declarations from a file or across the net.

Parameters:
purl -
translationSpace -
Returns:
Throws:
XMLTranslationException

getHeight

public int getHeight()

getTitle

public java.lang.String getTitle()

getWidth

public int getWidth()