Extension SDK 10.1.2

oracle.ide.config
Class DTCache

java.lang.Object
  extended byoracle.ide.config.DTCache
All Implemented Interfaces:
Copyable

public final class DTCache
extends java.lang.Object
implements Copyable

The DTCache is a persisted cache that can be used to store data that is not user-configurable. For example, this can be used to "remember" pieces of information, such as history information.


Constructor Summary
DTCache()
          Construct a new default DTCache instance.
 
Method Summary
 java.lang.Object copyTo(java.lang.Object target)
          Copies the internal state of this object to the specified copy.
 boolean getBoolean(java.lang.String dataKey, boolean defaultVal)
          Retrieves a previously cached boolean using the specified key.
 java.lang.Object getData(java.lang.String dataKey)
          Retrieves a previously added cached object from the cache using the specified key for lookup.
 int getInteger(java.lang.String dataKey, int defaultVal)
          Retrieves a previously cached integer using the specified key.
 java.lang.String getString(java.lang.String dataKey)
          Retrieves a previously cached String using the specified key.
 java.net.URL getURL(java.lang.String dataKey)
          Retrieves a previously cached URL using the specified key.
 boolean load()
          Loads the registered data from the XML file.
 void putBoolean(java.lang.String dataKey, boolean b)
          Stores a boolean into the cache using the specified key for lookup.
 void putBoolean(java.lang.String dataKey, java.lang.Boolean b)
          Stores a Boolean into the cache using the specified key for lookup.
 void putData(java.lang.String dataKey, Copyable data)
          Stores an object into the cache using the specified key for lookup.
 void putData(java.lang.String dataKey, java.util.List copyableList)
          Stores a list into the cache using the specified key for lookup.
 void putInteger(java.lang.String dataKey, int i)
          Stores an int into the cache using the specified key for lookup.
 void putInteger(java.lang.String dataKey, java.lang.Integer i)
          Stores an Integer into the cache using the specified key for lookup.
 void putString(java.lang.String dataKey, java.lang.String string)
          Stores a String into the cache using the specified key for lookup.
 void putURL(java.lang.String dataKey, java.net.URL url)
           
 boolean save()
          Saves the registered data to the XML file.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DTCache

public DTCache()
Construct a new default DTCache instance.

Method Detail

getData

public java.lang.Object getData(java.lang.String dataKey)
Retrieves a previously added cached object from the cache using the specified key for lookup.

Parameters:
dataKey - the key to use for looking up the object
Returns:
the associated cached object (if any)

getString

public java.lang.String getString(java.lang.String dataKey)
Retrieves a previously cached String using the specified key.

Parameters:
dataKey - the key to use for looking up the string
Returns:
the associated cached string (if any)

getInteger

public int getInteger(java.lang.String dataKey,
                      int defaultVal)
Retrieves a previously cached integer using the specified key.

Parameters:
dataKey - the key to use for looking up the value
defaultVal - the value to return if no cached value is found
Returns:
the associated cached integer; if no cached value is found, then defaultVal is returned

getBoolean

public boolean getBoolean(java.lang.String dataKey,
                          boolean defaultVal)
Retrieves a previously cached boolean using the specified key.

Parameters:
dataKey - the key to use for looking up the value
defaultVal - the value to return if no cached value is found
Returns:
the associated cached boolean; if no cached value is found, then defaultVal is returned

getURL

public java.net.URL getURL(java.lang.String dataKey)
Retrieves a previously cached URL using the specified key.

Parameters:
dataKey - the key to use for looking up the value
Returns:
the associated cached URL (if any)

putData

public void putData(java.lang.String dataKey,
                    Copyable data)
Stores an object into the cache using the specified key for lookup.

Parameters:
dataKey - the key to use for looking up the object
data - the data to store in the cache

putData

public void putData(java.lang.String dataKey,
                    java.util.List copyableList)
Stores a list into the cache using the specified key for lookup. Although not enforced, the items contained in the list must be basic items that are persistable, or are copyable implementations.

Parameters:
dataKey - the key to use for looking up the object
copyableList - the list to store in the cache

putString

public void putString(java.lang.String dataKey,
                      java.lang.String string)
Stores a String into the cache using the specified key for lookup.

Parameters:
dataKey - the key to use for looking up the value
string - the value to store

putBoolean

public void putBoolean(java.lang.String dataKey,
                       boolean b)
Stores a boolean into the cache using the specified key for lookup.

Parameters:
dataKey - the key to use for looking up the value
b - the value to store

putBoolean

public void putBoolean(java.lang.String dataKey,
                       java.lang.Boolean b)
Stores a Boolean into the cache using the specified key for lookup.

Parameters:
dataKey - the key to use for looking up the value
b - the value to store

putURL

public void putURL(java.lang.String dataKey,
                   java.net.URL url)

putInteger

public void putInteger(java.lang.String dataKey,
                       int i)
Stores an int into the cache using the specified key for lookup.

Parameters:
dataKey - the key to use for looking up the value
i - the value to store

putInteger

public void putInteger(java.lang.String dataKey,
                       java.lang.Integer i)
Stores an Integer into the cache using the specified key for lookup.

Parameters:
dataKey - the key to use for looking up the value
i - the value to store

save

public boolean save()
Saves the registered data to the XML file.


load

public boolean load()
Loads the registered data from the XML file.


copyTo

public java.lang.Object copyTo(java.lang.Object target)
Copies the internal state of this object to the specified copy.

Specified by:
copyTo in interface Copyable
Parameters:
target - The target object to which the state of this object should be copied. If target is null, then the copyTo method will return a new instance of this class.
Returns:
The object to which the state of this object was copied. If the target was non-null, then the return value is the same as the target object that was passed in; otherwise, the return value is a new instance of this class.

toString

public java.lang.String toString()
Returns:
the name of the dtcache.xml file

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.