DLESE Tools
v1.2

org.dlese.dpc.xml
Interface XMLDirectory

All Known Implementing Classes:
SimpleXMLDirectory

public interface XMLDirectory

Provides a hashmap-like interface to a collection of XML records, hashed with a user-defined key extracted from the XML record. This implies that the XML record contain an identifier value which is certain to be unique.

Although not strictly required, each implementing class should utilize the init method for intialization and subsequently call the destroy method in order to release resources.

Version:
0.9b, 05/20/02
Author:
Dave Deniman

Method Summary
 void destroy()
          Should release resources and call the finalize method.
 XMLMap getXMLMap(Object mapID)
          Getter method to retrieve a specific XMLMap.
 List getXMLMapKeys()
          Method to retrieve a list of the keys contained in the directory.
 List getXMLMaps()
          Method to retrieve the list of XMLMaps making up the directory.
 boolean init()
          Should initialize members as required.
 void setDirectory(int mapType, String keyField)
          Use this method to create the directory of XMLMap types using the given key.
 void setXMLMap(Object mapID, XMLMap valueMap)
          Setter method for storing or updating a specific XMLMap.
 

Method Detail

init

public boolean init()
Should initialize members as required.

Returns:
true if intialization successful, false otherwise

destroy

public void destroy()
Should release resources and call the finalize method.


setDirectory

public void setDirectory(int mapType,
                         String keyField)
Use this method to create the directory of XMLMap types using the given key.

The map type must be predefined, and implemented by XMLMapFactory.

Parameters:
keyField - the name of the field used in the XMLMaps being created, to use as key in directory.

getXMLMapKeys

public List getXMLMapKeys()
Method to retrieve a list of the keys contained in the directory.

Returns:
the list of keys used to hash the directory.

getXMLMaps

public List getXMLMaps()
Method to retrieve the list of XMLMaps making up the directory.

Returns:
the list of XMLMaps in the directory.

getXMLMap

public XMLMap getXMLMap(Object mapID)
Getter method to retrieve a specific XMLMap.

Parameters:
mapID - The key value identifying the specific XMLmap to retrieve.
Returns:
the requested XMLMap if it exists, null otherwise.

setXMLMap

public void setXMLMap(Object mapID,
                      XMLMap valueMap)
Setter method for storing or updating a specific XMLMap.

Parameters:
mapID - The key value identifying the specific XMLmap to update.
valueMap - The XMLMap to store in the directory.

DLESE Tools
v1.2