org.apache.myfaces.trinidadinternal.share.util
Class NamespaceMap

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.share.util.NamespaceMap
All Implemented Interfaces:
java.lang.Cloneable

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.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/util/NamespaceMap.java#0 $) $Date: 10-nov-2005.18:59:24 $
Author:
The Oracle ADF Faces Team

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.Iterator<java.lang.Object> getKeysIterator(java.lang.String namespace)
          Returns an Iterator over all of the keys for a particular namespace.
 java.util.Iterator<java.util.Map<java.lang.Object,java.lang.Object>> getNamespaceIterator()
          Returns an Iterator over all the namespaces added to the map.
 java.util.Iterator<java.lang.Object> getValueIterator()
          Returns an Enumeration over all the values added to the map.
 java.util.Iterator<java.lang.Object> getValueIterator(java.lang.String namespace)
          Returns an Iterator 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.


getNamespaceIterator

public java.util.Iterator<java.util.Map<java.lang.Object,java.lang.Object>> getNamespaceIterator()
Returns an Iterator over all the namespaces added to the map.


getValueIterator

public java.util.Iterator<java.lang.Object> getValueIterator()
Returns an Enumeration over all the values added to the map.


getValueIterator

public java.util.Iterator<java.lang.Object> getValueIterator(java.lang.String namespace)
Returns an Iterator over all of the values for a particular namespace.


getKeysIterator

public java.util.Iterator<java.lang.Object> getKeysIterator(java.lang.String namespace)
Returns an Iterator 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


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.