|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.extensions.xml.XMLObjectCache
Title: XMLObjectCache
Description: Multi level hashmap to contain name value pairs. A parent level can be explicitly accessed by prefixing the name with "../" otherwise the parent level will only be searched if the object does not exist at the current level.
Copyright: Copyright (c) 2003
Company: jfcunit project
Field Summary | |
private java.util.HashMap |
m_map
Internal hashmap used to hold the property/procedure mappings. |
private XMLObjectCache |
m_parent
The parent XMLObjectCache. |
Constructor Summary | |
XMLObjectCache()
Empty contructor. |
|
XMLObjectCache(XMLObjectCache parent)
Constructor. |
Method Summary | |
void |
clear()
Clear the cache. |
java.lang.Object |
get(java.lang.String name)
Get a object from the cache. |
java.lang.String |
getName(java.lang.Object value)
Do a reverse lookup of a mapping. |
java.lang.String[] |
getNames()
Get all of the names of the objects currently in the cache. |
XMLObjectCache |
getParent()
Get the parent object cache. |
void |
put(java.lang.String name,
java.lang.Object value)
Put a new mapping into the cache. |
void |
remove(java.lang.String name)
Remove the object from the cache. |
void |
setParent(XMLObjectCache parent)
Set the parent object cache. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final java.util.HashMap m_map
private XMLObjectCache m_parent
Constructor Detail |
public XMLObjectCache()
public XMLObjectCache(XMLObjectCache parent)
parent
- Parent object cache to be set.Method Detail |
public final java.lang.String getName(java.lang.Object value)
value
- Value to return the name for.
public final java.lang.String[] getNames()
public final void setParent(XMLObjectCache parent)
parent
- Parent object cache to be traversed by
get and explicitly traversed by put/remove.public final XMLObjectCache getParent()
public final void clear()
public final void put(java.lang.String name, java.lang.Object value)
name
- Name of the property or procedure.value
- Value of the property or procedure.public final void remove(java.lang.String name)
name
- Name of the object in the cache.public java.lang.Object get(java.lang.String name)
name
- Name of the value to be retrieved.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |