|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tomcat.util.collections.MultiMap
An efficient representation for certain type of map. The keys can have a single or multi values, but most of the time there are single values. The data is of "MessageBytes" type, meaning bytes[] that can be converted to Strings ( if needed, and encoding is lazy-binded ). This is a base class for MimeHeaders, Parameters and Cookies. Data structures: each field is a single-valued key/value. The fields are allocated when needed, and are recycled. The current implementation does linear search, in future we'll also use the hashkey.
Field Summary | |
protected int |
count
|
protected org.apache.tomcat.util.collections.MultiMap.Field[] |
fields
|
Constructor Summary | |
MultiMap(int initial_size)
|
Method Summary | |
int |
addField()
Create a new, unitialized entry. |
int |
find(java.lang.String name,
int starting)
Find the index of a field with the given name. |
int |
findFirst(java.lang.String name)
|
int |
findIgnoreCase(java.lang.String name,
int starting)
Find the index of a field with the given name. |
int |
findNext(int startPos)
|
MessageBytes |
get(java.lang.String name)
|
MessageBytes |
getName(int n)
Returns the Nth header name This may be used to iterate through all header fields. |
MessageBytes |
getValue(int n)
Returns the Nth header value This may be used to iterate through all header fields. |
void |
recycle()
Clears all header fields. |
void |
remove(int i)
Removes the field at the specified position. |
int |
size()
Returns the current number of header fields. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.tomcat.util.collections.MultiMap.Field[] fields
protected int count
Constructor Detail |
public MultiMap(int initial_size)
Method Detail |
public void recycle()
public int size()
public MessageBytes getName(int n)
public MessageBytes getValue(int n)
public int find(java.lang.String name, int starting)
public int findIgnoreCase(java.lang.String name, int starting)
public void remove(int i)
public int addField()
public MessageBytes get(java.lang.String name)
public int findFirst(java.lang.String name)
public int findNext(int startPos)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |