public abstract class

AbstractConfigurationElementList

extends AbstractConfigurationElement
implements ConfigurationElementList
java.lang.Object
   ↳ com.microstrategy.utils.config.AbstractConfigurationElement
     ↳ com.microstrategy.utils.config.AbstractConfigurationElementList
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

This is the base for those classes that represent a collection of ConfigurationElement instances. It should be extended by those classes whose child elements are all of the same type.

Summary

Constants
String ATT_VERSION Version attribute
[Expand]
Inherited Constants
From class com.microstrategy.utils.config.AbstractConfigurationElement
Public Constructors
AbstractConfigurationElementList()
AbstractConfigurationElementList(Node root)
AbstractConfigurationElementList(Document doc)
Public Methods
void clear()
Clears the element of the collection
Object clone()
ConfigurationElement get(int index)
ConfigurationElement get(Object key)
Object getKey(int index)
HashList getList()
Returns the collection of elements that are in the list.
Enumeration getValues()
This method is deprecated. It's not recommended to use this method. Instead you can just iterator through the elements of this object.
String getVersion()
Returns the version of the configuration file
boolean isEmpty()
Returns true if this list contains no elements.
void put(Object key, ConfigurationElement element)
Add an element to the collection
void put(ConfigurationElement element)
Add an element to the collection without providing a key
ConfigurationElement remove(Object key)
Removes an element from the collection
void setVersion(String version)
Sets the version of the configuration file
int size()
Retuns the size of the collection
void sort(Comparator comp)
Sorts the existing list according to the order induced by the specified comparator.
Protected Methods
AbstractConfigurationElement.FilteredList getFilteredList()
String getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.
void init(Node root)
This method is deprecated. use initFromXML(Node)
void registerElementInList(String nodeName, Class cls)
Register element to the list.
[Expand]
Inherited Methods
From class com.microstrategy.utils.config.AbstractConfigurationElement
From class java.lang.Object
From interface com.microstrategy.utils.config.ConfigurationElement
From interface com.microstrategy.utils.config.ConfigurationElementList
From interface com.microstrategy.utils.config.ConfigurationFile

Constants

public static final String ATT_VERSION

Version attribute

Constant Value: "version"

Public Constructors

public AbstractConfigurationElementList ()

public AbstractConfigurationElementList (Node root)

public AbstractConfigurationElementList (Document doc)

Public Methods

public void clear ()

Clears the element of the collection

public Object clone ()

Returns
  • a new instance of this object with the same values.

public ConfigurationElement get (int index)

Parameters
index the key of the object to return
Returns
  • An object of the collection with the given Key

public ConfigurationElement get (Object key)

Parameters
key the key of the object to return
Returns
  • An object of the collection with the given Key

public Object getKey (int index)

Parameters
index the index of the requested Object
Returns
  • the key ob the object in index

public HashList getList ()

Returns the collection of elements that are in the list. The list is filtered to include only non-deleted items.

public Enumeration getValues ()

This method is deprecated.
It's not recommended to use this method. Instead you can just iterator through the elements of this object.

Returns
  • an enumeration of the values currently in the collection

public String getVersion ()

Returns the version of the configuration file

Returns
  • the version of the configuration file

public boolean isEmpty ()

Returns true if this list contains no elements.

public void put (Object key, ConfigurationElement element)

Add an element to the collection

Parameters
key the key of the object
element the configelement to add

public void put (ConfigurationElement element)

Add an element to the collection without providing a key

Parameters
element the configelement to add

public ConfigurationElement remove (Object key)

Removes an element from the collection

Parameters
key the key of the object to remove
Returns
  • the ConfigurationElement object removed from the collection

public void setVersion (String version)

Sets the version of the configuration file

Parameters
version the version of the configuration file

public int size ()

Retuns the size of the collection

Returns
  • the size of the collection

public void sort (Comparator comp)

Sorts the existing list according to the order induced by the specified comparator.

Protected Methods

protected AbstractConfigurationElement.FilteredList getFilteredList ()

protected String getKeyAttribute ()

This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.

protected void init (Node root)

This method is deprecated.
use initFromXML(Node)

Initializes the list by extracting the xml version of the node and initializing the node from a file if the node inidcates so.

Parameters
root Node instance where the information for initializing this instance is defined.

protected void registerElementInList (String nodeName, Class cls)

Register element to the list. Class extends this class should use this method to register the element that will be put in the list.

Parameters
nodeName The node name of the in-list element
cls The class of the in-list element