com.timeindexing.util
Class CascadingMap

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended bycom.timeindexing.util.CascadingMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable
Direct Known Subclasses:
IndexProperties

public class CascadingMap
extends java.util.HashMap
implements java.util.Map

A cascading map is a map that holds its own map data, and also references a submap which also holds map data. A cascade of cascading maps can hold more than one version of a key in the individual maps. Any key in a map will supercede the same key in a submap. Keys will be found by traversing as many submaps as is necessary. The first one found will end the traversal.

Most of the methods of Map only work on this CascadingMap, they do not operate on submaps. Submaps appear to be read-only.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
CascadingMap()
          A constructor.
CascadingMap(CascadingMap aSubMap)
          A constructor which specifies a submap
CascadingMap(java.util.Properties properties)
          Construct a CascadingMap using a Properties object.
 
Method Summary
 boolean containsKey(java.lang.Object key)
          Does the casacading map contain a key.
 int depth()
          How deep is the CascadingMap.
 java.lang.Object get(java.lang.Object key)
          Get a value from the casacading map for a key.
 CascadingMap getSubmap()
          Get the submap from this CascadingMap.
 boolean hasSubmap()
          Is there a submap from this CascadingMap.
 java.util.Set keySet()
          Get all the keys in the casacading map.
 
Methods inherited from class java.util.HashMap
clear, clone, containsValue, entrySet, isEmpty, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsValue, entrySet, equals, hashCode, isEmpty, put, putAll, remove, size, values
 

Constructor Detail

CascadingMap

public CascadingMap()
A constructor.


CascadingMap

public CascadingMap(java.util.Properties properties)
Construct a CascadingMap using a Properties object. These mappings will have String objects.


CascadingMap

public CascadingMap(CascadingMap aSubMap)
A constructor which specifies a submap

Parameters:
aSubMap - an existing CascadingMap which will be a submap to this CascadingMap
Method Detail

containsKey

public boolean containsKey(java.lang.Object key)
Does the casacading map contain a key.

Specified by:
containsKey in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
Get a value from the casacading map for a key.

Specified by:
get in interface java.util.Map

keySet

public java.util.Set keySet()
Get all the keys in the casacading map.

Specified by:
keySet in interface java.util.Map

getSubmap

public CascadingMap getSubmap()
Get the submap from this CascadingMap.


hasSubmap

public boolean hasSubmap()
Is there a submap from this CascadingMap.


depth

public int depth()
How deep is the CascadingMap.