ecologylab.xml.types.element
Class VectorState<T extends ElementState>

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.xml.ElementState
          extended by ecologylab.xml.types.element.VectorState<T>
All Implemented Interfaces:
OptimizationTypes, XMLTranslationExceptionTypes

public class VectorState<T extends ElementState>
extends ElementState

An ElementState XML tree node for collecting a set of nested elements, using a Vector (synchronized).

In general, one should use ArrayListState for this kind of functionality, but, in some cases, there may be concurrency issues, in which case, this more expensive class will be required.

Author:
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
 java.util.Vector<T> 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
VectorState()
           
 
Method Summary
 void add(T elementState)
           
 void clear()
          Remove all elements from our Collection.
protected  java.util.Collection<? extends ElementState> getCollection(java.lang.Class thatClass)
          Return the collection object associated with this
 void recycle()
          Clear data structures and references to enable garbage collecting of resources associated with this.
 int size()
          Get the number of elements in the set.
 
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, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

set

public java.util.Vector<T extends ElementState> set
Constructor Detail

VectorState

public VectorState()
Method Detail

add

public void add(T elementState)

getCollection

protected java.util.Collection<? extends ElementState> getCollection(java.lang.Class thatClass)
Return the collection object associated with this

Overrides:
getCollection in class ElementState
Parameters:
thatClass - The class of the ElementState superclass that could be stored in a Collection.
Returns:
The ArrayList we collect in.

clear

public void clear()
Remove all elements from our Collection.


size

public int size()
Get the number of elements in the set.

Returns:

recycle

public void recycle()
Description copied from class: ElementState
Clear data structures and references to enable garbage collecting of resources associated with this.

Overrides:
recycle in class ElementState
See Also:
ElementState.recycle()