org.opencms.util
Class CmsConstantMap

java.lang.Object
  extended by org.opencms.util.CmsConstantMap
All Implemented Interfaces:
java.util.Map

public class CmsConstantMap
extends java.lang.Object
implements java.util.Map

Returns the constant Object the map was initialized with for all get(Object) calls, regardless of what the actual key is.

Since:
7.0.2
Version:
$Revision: 1.5 $
Author:
Alexander Kandzior

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
static java.util.Map CONSTANT_BOOLEAN_FALSE_MAP
          Constant Map that always returns Boolean.FALSE.
static java.util.Map CONSTANT_BOOLEAN_TRUE_MAP
          Constant Map that always returns Boolean.TRUE.
static java.util.Map CONSTANT_EMPTY_LIST_MAP
          Constant Map that always returns an empty list.
 
Constructor Summary
CmsConstantMap(java.lang.Object constant)
          Creates a new constant Map.
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object get(java.lang.Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 java.util.Set keySet()
           
 java.lang.Object put(java.lang.Object arg0, java.lang.Object arg1)
           
 void putAll(java.util.Map arg0)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
           
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_BOOLEAN_FALSE_MAP

public static final java.util.Map CONSTANT_BOOLEAN_FALSE_MAP
Constant Map that always returns Boolean.FALSE.


CONSTANT_BOOLEAN_TRUE_MAP

public static final java.util.Map CONSTANT_BOOLEAN_TRUE_MAP
Constant Map that always returns Boolean.TRUE.


CONSTANT_EMPTY_LIST_MAP

public static final java.util.Map CONSTANT_EMPTY_LIST_MAP
Constant Map that always returns an empty list.

Constructor Detail

CmsConstantMap

public CmsConstantMap(java.lang.Object constant)
Creates a new constant Map.

Parameters:
constant - the constant to return for all get(Object) calls.

Method Detail

clear

public void clear()
Specified by:
clear in interface java.util.Map
See Also:
Map.clear()

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map
See Also:
Map.containsKey(java.lang.Object)

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map
See Also:
Map.containsValue(java.lang.Object)

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map
See Also:
Map.entrySet()

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
See Also:
Map.get(java.lang.Object)

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map
See Also:
Map.isEmpty()

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
See Also:
Map.keySet()

put

public java.lang.Object put(java.lang.Object arg0,
                            java.lang.Object arg1)
Specified by:
put in interface java.util.Map
See Also:
Map.put(java.lang.Object, java.lang.Object)

putAll

public void putAll(java.util.Map arg0)
Specified by:
putAll in interface java.util.Map
See Also:
Map.putAll(java.util.Map)

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
See Also:
Map.remove(java.lang.Object)

size

public int size()
Specified by:
size in interface java.util.Map
See Also:
Map.size()

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map
See Also:
Map.values()