org.apache.felix.ipojo.context
Class StringMap

java.lang.Object
  extended by java.util.AbstractMap
      extended by java.util.TreeMap
          extended by org.apache.felix.ipojo.context.StringMap
All Implemented Interfaces:
Serializable, Cloneable, Map, SortedMap

public class StringMap
extends TreeMap

Simple utility class that creates a map for string-based keys by extending TreeMap. This map can be set to use case-sensitive or case-insensitive comparison when searching for the key. Any keys put into this map will be converted to a String using the toString() method, since it is only intended to compare strings.

Author:
Felix Project Team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry
 
Constructor Summary
StringMap()
          Constructor.
StringMap(boolean caseSensitive)
          Constructor.
StringMap(Map map, boolean caseSensitive)
          Constructor.
 
Method Summary
 boolean isCaseSensitive()
          Check if the map is case-sensitive.
 Object put(Object key, Object value)
          Put a record in the map.
 void setCaseSensitive(boolean flag)
          Set the case sensitivity.
 
Methods inherited from class java.util.TreeMap
clear, clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, putAll, remove, size, subMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Constructor Detail

StringMap

public StringMap()
Constructor.


StringMap

public StringMap(boolean caseSensitive)
Constructor.

Parameters:
caseSensitive - : fix if the map if case sensitive or not.

StringMap

public StringMap(Map map,
                 boolean caseSensitive)
Constructor.

Parameters:
map - : initial properties.
caseSensitive - : fix if the map if case sensitive or not.
Method Detail

put

public Object put(Object key,
                  Object value)
Put a record in the map.

Specified by:
put in interface Map
Overrides:
put in class TreeMap
Parameters:
key - : key
value - : value
Returns:
an object.
See Also:
java.util.TreeMap#put(K, V)

isCaseSensitive

public boolean isCaseSensitive()
Check if the map is case-sensitive.

Returns:
true if the map is case sensitive.

setCaseSensitive

public void setCaseSensitive(boolean flag)
Set the case sensitivity.

Parameters:
flag - : the new case sensitivity.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.