org.eclipse.webdav.internal.kernel.utils
Class NestedHashtable

java.lang.Object
  extended by org.eclipse.webdav.internal.kernel.utils.NestedHashtable

public class NestedHashtable
extends Object


Field Summary
protected  NestedHashtable defaults
           
protected  Hashtable localValues
           
 
Constructor Summary
NestedHashtable()
           
NestedHashtable(NestedHashtable defaults)
          Constructor for the class.
 
Method Summary
 void collapse()
          Copy all the default values into the receiver.
 Object get(Object key)
          Return the value for the given key.
 Enumeration keys()
          Return an enumeration over the context's keys.
 void put(Object key, Object value)
          Put the given key-value pair into the context.
 Object remove(Object key)
          Remove the given key from the context
 String toString()
          Return a string representation of the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

localValues

protected Hashtable localValues

defaults

protected NestedHashtable defaults
Constructor Detail

NestedHashtable

public NestedHashtable()

NestedHashtable

public NestedHashtable(NestedHashtable defaults)
Constructor for the class. Set the defaults to be the given value.

Parameters:
defaults - the default values for the receiver
Method Detail

collapse

public void collapse()
Copy all the default values into the receiver.


get

public Object get(Object key)
Return the value for the given key.

Parameters:
key - the key to look up
Returns:
the value for the key or null if none.

keys

public Enumeration keys()
Return an enumeration over the context's keys. (recursively computes the keys based on keys defaults as well)

Returns:
an enumeration over the context keys

put

public void put(Object key,
                Object value)
Put the given key-value pair into the context.

Parameters:
key - the key
value - its associated value

remove

public Object remove(Object key)
Remove the given key from the context

Parameters:
key - the key to remove

toString

public String toString()
Return a string representation of the context.

Overrides:
toString in class Object
Returns:
the context, as a String
See Also:
toString()


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.