org.alltimeflashdreamer.filelister.xml
Class AbstractConfigElementList

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byorg.alltimeflashdreamer.filelister.xml.AbstractConfigElementList
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable
Direct Known Subclasses:
Directory, Index, JDBC, Link, System, Zip

abstract class AbstractConfigElementList
extends ArrayList

Title: AbstractConfigElementList

Description: This is the superclass of each list of ConfigElement classes, representing all together one "main node" of the FileLister config file.

Organization: All Time Flash Dreamer

Version:
0.5.1
Author:
Copyright (c) 2002-2004 by Florian Steinsiepe

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
(package private) AbstractConfigElementList(Element element, boolean bLoadDefaults)
          Initializes the list with the given Element node.
 
Method Summary
 ConfigElement getConfigElement(String sElementName)
          Returns the element with the given name.
 String getName()
          Returns the name of the list's underlying element.
 String getPropertyName(int iPosition)
          Returns the name of the ConfigElement at the given position.
 Object getPropertyValue(int iPosition)
          Returns the value of the ConfigElement at the given position.
 String getPropertyValue(String sName)
          Returns the value of the ConfigElement having the given name as a String .
 void setValues(FileListerTableModel model)
          Searches the model for the properties named "getName().
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

AbstractConfigElementList

AbstractConfigElementList(Element element,
                          boolean bLoadDefaults)
Initializes the list with the given Element node. This leads to a scanning of the node for children of type Element; for each such child, an instance of ConfigElement is added to the list.

Parameters:
element - the Element representing the node containing all the child elements / config settings of this node
bLoadDefaults - whether to load the default values or not
Method Detail

getPropertyName

public String getPropertyName(int iPosition)
Returns the name of the ConfigElement at the given position. If this position is out of range, null is returned. The name is formatted like "<list-name>.<element-name>"

Parameters:
iPosition - the position of the wished element within the list
Returns:
the name of the ConfigElement at the given position or null

getPropertyValue

public Object getPropertyValue(int iPosition)
Returns the value of the ConfigElement at the given position. If this position is out of range, null is returned.

Parameters:
iPosition - the position of the wished element within the list
Returns:
the value of the ConfigElement at the given position or null

getPropertyValue

public String getPropertyValue(String sName)
Returns the value of the ConfigElement having the given name as a String . If this name isn't known, null is returned.

Parameters:
sName - the name of the wished element within the list
Returns:
the value of the ConfigElement having the given name or null

getName

public String getName()
Returns the name of the list's underlying element.

Returns:
the list name

getConfigElement

public ConfigElement getConfigElement(String sElementName)
Returns the element with the given name. If this element isn't found in the list, null is returned.

Parameters:
sElementName - a name specifying an ConfigElement instance
Returns:
the specified element or null

setValues

public void setValues(FileListerTableModel model)
Searches the model for the properties named "getName().<some-name>". The valueo of each such property is stored within the related ConfigElement, i.e. within the DOM itself.

Parameters:
model - the model to get the property names and values from