public class StringMap extends AbstractMap implements Externalizable
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
protected static int |
__HASH_WIDTH |
protected HashSet |
_entrySet |
protected boolean |
_ignoreCase |
protected org.eclipse.jetty.util.StringMap.NullEntry |
_nullEntry |
protected Object |
_nullValue |
protected org.eclipse.jetty.util.StringMap.Node |
_root |
protected Set |
_umEntrySet |
protected int |
_width |
static boolean |
CASE_INSENSTIVE |
Constructor and Description |
---|
StringMap()
Constructor.
|
StringMap(boolean ignoreCase)
Constructor.
|
StringMap(boolean ignoreCase,
int width)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
Set |
entrySet() |
Object |
get(Object key) |
Object |
get(String key) |
Map.Entry |
getBestEntry(byte[] key,
int offset,
int maxLength)
Get a map entry by byte array key, using as much of the passed key as needed for a match.
|
Map.Entry |
getEntry(char[] key,
int offset,
int length)
Get a map entry by char array key.
|
Map.Entry |
getEntry(String key,
int offset,
int length)
Get a map entry by substring key.
|
int |
getWidth() |
boolean |
isEmpty() |
boolean |
isIgnoreCase() |
Object |
put(Object key,
Object value) |
Object |
put(String key,
Object value) |
void |
readExternal(ObjectInput in) |
Object |
remove(Object key) |
Object |
remove(String key) |
void |
setIgnoreCase(boolean ic)
Set the ignoreCase attribute.
|
void |
setWidth(int width)
Set the hash width.
|
int |
size() |
void |
writeExternal(ObjectOutput out) |
clone, containsValue, equals, hashCode, keySet, putAll, toString, values
public static final boolean CASE_INSENSTIVE
protected static final int __HASH_WIDTH
protected int _width
protected org.eclipse.jetty.util.StringMap.Node _root
protected boolean _ignoreCase
protected org.eclipse.jetty.util.StringMap.NullEntry _nullEntry
protected Object _nullValue
protected HashSet _entrySet
protected Set _umEntrySet
public StringMap()
public StringMap(boolean ignoreCase)
ignoreCase
- public StringMap(boolean ignoreCase, int width)
ignoreCase
- width
- Width of hash tables, larger values are faster but
use more memory.public void setIgnoreCase(boolean ic)
ic
- If true, the map is case insensitive for keys.public boolean isIgnoreCase()
public void setWidth(int width)
width
- Width of hash tables, larger values are faster but
use more memory.public int getWidth()
public Object put(Object key, Object value)
put
in interface Map
put
in class AbstractMap
public Object get(Object key)
get
in interface Map
get
in class AbstractMap
public Map.Entry getEntry(String key, int offset, int length)
key
- String containing the keyoffset
- Offset of the key within the String.length
- The length of the keypublic Map.Entry getEntry(char[] key, int offset, int length)
key
- char array containing the keyoffset
- Offset of the key within the array.length
- The length of the keypublic Map.Entry getBestEntry(byte[] key, int offset, int maxLength)
key
- char array containing the keyoffset
- Offset of the key within the array.maxLength
- The length of the keypublic Object remove(Object key)
remove
in interface Map
remove
in class AbstractMap
public Set entrySet()
entrySet
in interface Map
entrySet
in class AbstractMap
public int size()
size
in interface Map
size
in class AbstractMap
public boolean isEmpty()
isEmpty
in interface Map
isEmpty
in class AbstractMap
public boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in class AbstractMap
public void clear()
clear
in interface Map
clear
in class AbstractMap
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright © 1995-2012 Mort Bay Consulting. All Rights Reserved.