| java.lang.Object java.util.AbstractMap org.mortbay.util.StringMap
StringMap | public class StringMap extends AbstractMap implements Externalizable(Code) | | Map implementation Optimized for Strings keys..
This String Map has been optimized for mapping small sets of
Strings where the most frequently accessed Strings have been put to
the map first.
It also has the benefit that it can look up entries by substring or
sections of char and byte arrays. This can prevent many String
objects from being created just to look up in the map.
This map is NOT synchronized.
author: Greg Wilkins (gregw) |
Constructor Summary | |
public | StringMap() Constructor. | public | StringMap(boolean ignoreCase) Constructor. | public | StringMap(boolean ignoreCase, int width) Constructor. |
CASE_INSENSTIVE | final public static boolean CASE_INSENSTIVE(Code) | | |
__HASH_WIDTH | final protected static int __HASH_WIDTH(Code) | | |
_ignoreCase | protected boolean _ignoreCase(Code) | | |
_nullEntry | protected NullEntry _nullEntry(Code) | | |
_root | protected Node _root(Code) | | |
_width | protected int _width(Code) | | |
StringMap | public StringMap()(Code) | | Constructor.
|
StringMap | public StringMap(boolean ignoreCase)(Code) | | Constructor.
Parameters: ignoreCase - |
StringMap | public StringMap(boolean ignoreCase, int width)(Code) | | Constructor.
Parameters: ignoreCase - Parameters: width - Width of hash tables, larger values are faster butuse more memory. |
clear | public void clear()(Code) | | |
getBestEntry | public Map.Entry getBestEntry(byte[] key, int offset, int maxLength)(Code) | | Get a map entry by byte array key, using as much of the passed key as needed for a match.
A simple 8859-1 byte to char mapping is assumed.
Parameters: key - char array containing the key Parameters: offset - Offset of the key within the array. Parameters: maxLength - The length of the key The Map.Entry for the key or null if the key is not inthe map. |
getEntry | public Map.Entry getEntry(String key, int offset, int length)(Code) | | Get a map entry by substring key.
Parameters: key - String containing the key Parameters: offset - Offset of the key within the String. Parameters: length - The length of the key The Map.Entry for the key or null if the key is not inthe map. |
getEntry | public Map.Entry getEntry(char[] key, int offset, int length)(Code) | | Get a map entry by char array key.
Parameters: key - char array containing the key Parameters: offset - Offset of the key within the array. Parameters: length - The length of the key The Map.Entry for the key or null if the key is not inthe map. |
getWidth | public int getWidth()(Code) | | |
isEmpty | public boolean isEmpty()(Code) | | |
isIgnoreCase | public boolean isIgnoreCase()(Code) | | |
setIgnoreCase | public void setIgnoreCase(boolean ic)(Code) | | Set the ignoreCase attribute.
Parameters: ic - If true, the map is case insensitive for keys. |
setWidth | public void setWidth(int width)(Code) | | Set the hash width.
Parameters: width - Width of hash tables, larger values are faster butuse more memory. |
|
|