com.mindtree.techworks.insight.preferences.xmlpersistence
Class XMLPreferenceDataCache

java.lang.Object
  extended by com.mindtree.techworks.insight.preferences.xmlpersistence.XMLPreferenceDataCache

public class XMLPreferenceDataCache
extends java.lang.Object

This class will be used to cache the XML Preference Related Data. This is a singleton class.

Version:
$Revision: 27 $ $Date: 2007-12-16 04:58:03 -0700 (Sun, 16 Dec 2007) $
Author:
Bindul Bhowmik
See Also:
XMLPreferenceDataHandler

Method Summary
 void addPreference(Preference preference)
          Adds a preference to the cache.
 java.util.Collection getAllPreferences()
          Returns all the preferences from the cache.
static XMLPreferenceDataCache getInstance()
          Returns the singleton instance.
 Preference getPreference(java.lang.String preferenceId)
          Returns a preference from the cache, if present or retuns null.
 boolean isXMLLoaded()
          If the XML is loaded.
 boolean isXMLValidated()
           
 java.util.Iterator iteratePreferences()
          Returns an iterator to all cached preferences.
 void setXMLLoaded(boolean isXMLLoaded)
          Sets the value to the xml loaded status.
 void setXMLValidated(boolean isXMLValidated)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static XMLPreferenceDataCache getInstance()
Returns the singleton instance.

Returns:
the singleton instance.

addPreference

public void addPreference(Preference preference)
Adds a preference to the cache. If the preference with the same key is already present in the cache, it will be overwritten.

Parameters:
preference - The preference to add to the cache.

getPreference

public Preference getPreference(java.lang.String preferenceId)
Returns a preference from the cache, if present or retuns null.

Parameters:
preferenceId - The id for which preference is required.
Returns:
The preference if present or null.

getAllPreferences

public java.util.Collection getAllPreferences()
Returns all the preferences from the cache.

Returns:
A collection of Preference objects.

iteratePreferences

public java.util.Iterator iteratePreferences()
Returns an iterator to all cached preferences.

Returns:
An iterator to all the cache preferences.

isXMLLoaded

public boolean isXMLLoaded()
If the XML is loaded.

Returns:
Returns the isXMLLoaded.

setXMLLoaded

public void setXMLLoaded(boolean isXMLLoaded)
Sets the value to the xml loaded status.

Parameters:
isXMLLoaded - The isXMLLoaded to set.

isXMLValidated

public boolean isXMLValidated()
Returns:
Returns the isXMLValidated.

setXMLValidated

public void setXMLValidated(boolean isXMLValidated)
Parameters:
isXMLValidated - The isXMLValidated to set.


Copyright © 2003-2008 MindTree Consulting Ltd.. All Rights Reserved.