org.millscript.millscript.datatypes
Class NullMapWithDefault

java.lang.Object
  extended by java.util.AbstractMap
      extended by org.millscript.millscript.datatypes.NullMapWithDefault
All Implemented Interfaces:
java.io.Serializable, java.util.Map, MapWithDefault

Deprecated. As of MillScript 10.2.0, this functionallity has been subsumed by the MillScript-Util project and it's Map API, see IEmptyMap.

@Deprecated
public class NullMapWithDefault
extends java.util.AbstractMap
implements MapWithDefault, java.io.Serializable

A MapWithDefault implementation that can have a default value, but no keys or values. This is used in situations where you need to have a map available, but you will never be able to place keys and values in it. For instance, this is used by GroupFunction for higher level defaults on Maps, when creating multi-level groups.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
NullMapWithDefault(int depth, java.lang.Object obj)
          Deprecated. Constructs a new NullMap with the specified depth and default value.
 
Method Summary
 java.util.Set entrySet()
          Deprecated. Returns a special NullSet, as this map will never contain any values.
 java.lang.Object getDefault()
          Deprecated. Returns the default value for this map.
 void setDefault(java.lang.Object d)
          Deprecated. Sets the default value for this map to the specified value.
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

NullMapWithDefault

public NullMapWithDefault(int depth,
                          java.lang.Object obj)
Deprecated. 
Constructs a new NullMap with the specified depth and default value. The depth refers to the number of times you have to index this map to reach the bottom, hence retrieve the default value. At the top level, the default value will be another NullMap, with a depth one less than this level. This default NullMap will have a default value of another NullMap, with a depth one less again, and so on until the depth is zero, where the NullMap will have the specified default value.

Parameters:
depth - the number of times you have to index this map to the "bottom"
obj - the default object to be returned from the bottom of this map
Method Detail

getDefault

public java.lang.Object getDefault()
Deprecated. 
Description copied from interface: MapWithDefault
Returns the default value for this map.

Specified by:
getDefault in interface MapWithDefault
Returns:
the default value for this map.
See Also:
MapWithDefault.getDefault()

setDefault

public void setDefault(java.lang.Object d)
Deprecated. 
Description copied from interface: MapWithDefault
Sets the default value for this map to the specified value.

Specified by:
setDefault in interface MapWithDefault
Parameters:
d - the new default value for this map.
See Also:
MapWithDefault.setDefault(java.lang.Object)

entrySet

public java.util.Set entrySet()
Deprecated. 
Returns a special NullSet, as this map will never contain any values.

Specified by:
entrySet in interface java.util.Map
Specified by:
entrySet in class java.util.AbstractMap
Returns:
a set of no values


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.