Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.share.util
Class NamespaceMap

java.lang.Object
  |
  +--oracle.cabo.share.util.NamespaceMap
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
BindableNamespaceMap

public class NamespaceMap
extends java.lang.Object
implements java.lang.Cloneable

Implements a map between a namespace+key and a value. This unsynchronized class is optimized for a small number of namespaces.


Constructor Summary
NamespaceMap()
          Creates a NamespaceMap, using a default size for the number of values per namespace.
NamespaceMap(int defaultSize)
          Creates a NamespaceMap.
 
Method Summary
 void clear()
          clears all bindings for all namespaces.
 void clear(java.lang.String namespace)
          clears all keys from a namespace.
 java.lang.Object clone()
          Returns a clone of the NamespaceMap
 java.lang.Object get(java.lang.String namespace, java.lang.Object key)
          Returns the stored object.
 java.util.Enumeration getKeysEnumeration(java.lang.String namespace)
          Returns an Enumeration over all of the keys for a particular namespace.
 java.util.Enumeration getNamespaceEnumeration()
          Returns an Enumeration over all the namespaces added to the map.
 java.util.Enumeration getValueEnumeration()
          Returns an Enumeration over all the values added to the map.
 java.util.Enumeration getValueEnumeration(java.lang.String namespace)
          Returns an Enumeration over all of the values for a particular namespace.
 void put(java.lang.String namespace, java.lang.Object key, java.lang.Object value)
          associates a value with a namespace and a key
 java.lang.Object remove(java.lang.String namespace, java.lang.Object key)
          Removes a key from a namespace.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceMap

public NamespaceMap()
Creates a NamespaceMap, using a default size for the number of values per namespace.

NamespaceMap

public NamespaceMap(int defaultSize)
Creates a NamespaceMap.
Parameters:
defaultSize - the default size of each per-namespace storage.
Method Detail

put

public void put(java.lang.String namespace,
                java.lang.Object key,
                java.lang.Object value)
associates a value with a namespace and a key
Parameters:
namespace - namespace of the value
key - the key to associate the value with
value - the value to associate with the key.

get

public java.lang.Object get(java.lang.String namespace,
                            java.lang.Object key)
Returns the stored object.
Parameters:
namespace - the namespace to search.
key - the key to search the namespace for.
Returns:
null if such a namespace/key does not exist. else returns the associated value.

remove

public java.lang.Object remove(java.lang.String namespace,
                               java.lang.Object key)
Removes a key from a namespace.
Parameters:
namespace - the namespace to search.
key - the key to search the namespace for.
Returns:
the associated value, or null if the namespace/key does not exist.

clear

public void clear(java.lang.String namespace)
clears all keys from a namespace.
Parameters:
namespace - the namespace to clear.

clear

public void clear()
clears all bindings for all namespaces.

getNamespaceEnumeration

public java.util.Enumeration getNamespaceEnumeration()
Returns an Enumeration over all the namespaces added to the map.

getValueEnumeration

public java.util.Enumeration getValueEnumeration()
Returns an Enumeration over all the values added to the map.

getValueEnumeration

public java.util.Enumeration getValueEnumeration(java.lang.String namespace)
Returns an Enumeration over all of the values for a particular namespace.

getKeysEnumeration

public java.util.Enumeration getKeysEnumeration(java.lang.String namespace)
Returns an Enumeration over all of the keys for a particular namespace.

clone

public java.lang.Object clone()
Returns a clone of the NamespaceMap
Overrides:
clone in class java.lang.Object

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.