org.apache.solr.util
Class CharArrayMap<V>
java.lang.Object
java.util.AbstractMap<java.lang.String,V>
org.apache.solr.util.CharArrayMap<V>
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,V>
public class CharArrayMap<V>
- extends java.util.AbstractMap<java.lang.String,V>
- implements java.util.Map<java.lang.String,V>, java.lang.Cloneable, java.io.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 class java.util.AbstractMap |
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
|
Constructor Summary |
CharArrayMap(int initialCapacity,
boolean ignoreCase)
Create map with enough capacity to hold startSize
terms |
| Methods inherited from class java.util.AbstractMap |
equals, hashCode, keySet, putAll, remove, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
equals, hashCode, keySet, putAll, remove, values |
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(java.lang.CharSequence key)
get
public V get(java.lang.Object key)
- Specified by:
get in interface java.util.Map<java.lang.String,V>- Overrides:
get in class java.util.AbstractMap<java.lang.String,V>
containsKey
public boolean containsKey(java.lang.Object s)
- Specified by:
containsKey in interface java.util.Map<java.lang.String,V>- Overrides:
containsKey in class java.util.AbstractMap<java.lang.String,V>
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue in interface java.util.Map<java.lang.String,V>- Overrides:
containsValue in class java.util.AbstractMap<java.lang.String,V>
put
public V put(java.lang.CharSequence key,
V val)
put
public V put(java.lang.String key,
V val)
- Specified by:
put in interface java.util.Map<java.lang.String,V>- Overrides:
put in class java.util.AbstractMap<java.lang.String,V>
put
public V put(char[] key,
java.lang.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 java.util.Map<java.lang.String,V>- Overrides:
size in class java.util.AbstractMap<java.lang.String,V>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface java.util.Map<java.lang.String,V>- Overrides:
isEmpty in class java.util.AbstractMap<java.lang.String,V>
clear
public void clear()
- Specified by:
clear in interface java.util.Map<java.lang.String,V>- Overrides:
clear in class java.util.AbstractMap<java.lang.String,V>
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,V>> entrySet()
- Specified by:
entrySet in interface java.util.Map<java.lang.String,V>- Specified by:
entrySet in class java.util.AbstractMap<java.lang.String,V>
iterator
public CharArrayMap.EntryIterator iterator()
- Returns an EntryIterator over this Map.
clone
public java.lang.Object clone()
- Overrides:
clone in class java.util.AbstractMap<java.lang.String,V>
Copyright © 2006-2010 Hibernate. All Rights Reserved.