org.apache.solr.util
Class CharArrayMap<V>
java.lang.Object
java.util.AbstractMap<String,V>
org.apache.solr.util.CharArrayMap<V>
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,V>
public class CharArrayMap<V>
- extends AbstractMap<String,V>
- implements Map<String,V>, Cloneable, Serializable
A simple class that stores key Strings as char[]'s in a
hash table. Note that this is not a general purpose
class. For example, it cannot remove items from the
map, nor does it resize its hash table to be smaller,
etc. It is designed to be quick to retrieve items
by char[] keys without the necessity of converting
to a String first.
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
|
Constructor Summary |
CharArrayMap(int initialCapacity,
boolean ignoreCase)
Create map with enough capacity to hold startSize
terms |
CharArrayMap
public CharArrayMap(int initialCapacity,
boolean ignoreCase)
- Create map with enough capacity to hold startSize
terms
ignoreCase
public boolean ignoreCase()
get
public V get(char[] key)
get
public V get(char[] key,
int off,
int len)
get
public V get(CharSequence key)
get
public V get(Object key)
- Specified by:
get in interface Map<String,V>- Overrides:
get in class AbstractMap<String,V>
containsKey
public boolean containsKey(Object s)
- Specified by:
containsKey in interface Map<String,V>- Overrides:
containsKey in class AbstractMap<String,V>
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue in interface Map<String,V>- Overrides:
containsValue in class AbstractMap<String,V>
put
public V put(CharSequence key,
V val)
put
public V put(String key,
V val)
- Specified by:
put in interface Map<String,V>- Overrides:
put in class AbstractMap<String,V>
put
public V put(char[] key,
Object val)
- Add this key,val pair to the map.
The char[] key is directly used, no copy is made.
If ignoreCase is true for this Map, the key array will be directly modified.
The user should never modify the key after calling this method.
size
public int size()
- Specified by:
size in interface Map<String,V>- Overrides:
size in class AbstractMap<String,V>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Map<String,V>- Overrides:
isEmpty in class AbstractMap<String,V>
clear
public void clear()
- Specified by:
clear in interface Map<String,V>- Overrides:
clear in class AbstractMap<String,V>
entrySet
public Set<Map.Entry<String,V>> entrySet()
- Specified by:
entrySet in interface Map<String,V>- Specified by:
entrySet in class AbstractMap<String,V>
iterator
public CharArrayMap.EntryIterator iterator()
- Returns an EntryIterator over this Map.
clone
public Object clone()
- Overrides:
clone in class AbstractMap<String,V>
Copyright © 2006-2010 Hibernate. All Rights Reserved.