|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectice.util.net.HeaderMap
The HeaderMap class represents a collection of
s each consisting of a field name and a field
value. The HeaderMap class allows duplicate field name entries!
HeaderMap.Header
| Nested Class Summary | |
static class |
HeaderMap.Header
|
| Constructor Summary | |
HeaderMap()
Constructs an empty HeaderMap. |
|
HeaderMap(int initialCapacity)
Constructs an empty HeaderMap with the specified
initialCapacity. |
|
| Method Summary | |
void |
clear()
Removes all the headers from this HeaderMap. |
Object |
clone()
|
boolean |
containsFieldName(String fieldName)
Returns true if this HeaderMap contains a
mapping for the specified fieldName. |
void |
ensureCapacity(int minimumCapacity)
Increases the capacity of this HeaderMap instance, if
necessary, to ensure that it can hold at least the number of headers
specified by the minimumCapacity argument. |
boolean |
equals(Object object)
|
HeaderMap.Header |
get(int index)
Returns the Header at the specified index in
this HeaderMap. |
String |
getFieldName(int index)
Returns the field name at the specified index in this
HeaderMap. |
String |
getFieldValue(int index)
Returns the field value at the specified index in this
HeaderMap. |
String[] |
getFieldValues(String fieldName)
Returns the field value that is mapped with the specified fieldName in this HeaderMap. |
int |
getSize()
Returns the number of Headers in this
HeaderMap. |
boolean |
isEmpty()
Returns true if this HeaderMap contains no
headers. |
void |
putHeader(String fieldName,
String fieldValue)
Maps the specified fieldValue with the specified
fieldName in this HeaderMap. |
void |
putHeader(String fieldName,
String fieldValue,
boolean replace)
Maps the specified fieldValue with the specified
fieldName in this HeaderMap. |
void |
removeHeader(int index)
Removes the mapping at the specified index from this
HeaderMap if present. |
void |
removeHeaders(String fieldName)
Removes all mappings for the specified fieldName from
this HeaderMap if one is present. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public HeaderMap()
HeaderMap.
public HeaderMap(int initialCapacity)
throws IllegalArgumentException
Constructs an empty HeaderMap with the specified
initialCapacity.
initialCapacity - the initial capacity of the HeaderMap.
IllegalArgumentException - if the specified initialCapacity is less
than 0.| Method Detail |
public void clear()
Removes all the headers from this HeaderMap. This
HeaderMap will be empty after this call returns.
public Object clone()
public boolean containsFieldName(String fieldName)
Returns true if this HeaderMap contains a
mapping for the specified fieldName.
fieldName - field name whose presence in this HeaderMap
is to be tested.
true if this HeaderMap contains a
mapping for the specified fieldName.public void ensureCapacity(int minimumCapacity)
Increases the capacity of this HeaderMap instance, if
necessary, to ensure that it can hold at least the number of headers
specified by the minimumCapacity argument.
minimumCapacity - the desired minimum capacity.public boolean equals(Object object)
public HeaderMap.Header get(int index)
Returns the Header at the specified index in
this HeaderMap.
index - the index of the Header to return.
Header at the specified index
in this HeaderMap, or null.public String getFieldName(int index)
Returns the field name at the specified index in this
HeaderMap.
index - the index of the field name to return.
index in this
HeaderMap, or null.public String getFieldValue(int index)
Returns the field value at the specified index in this
HeaderMap.
index - the index of the field value to return.
index in this
HeaderMap, or null.public String[] getFieldValues(String fieldName)
Returns the field value that is mapped with the specified
fieldName in this HeaderMap.
If this HeaderMap contains more than one mapping with the
specified fieldName, all the field values are returned.
fieldName - the field name whose mapped field value is to be
returned.
HeaderMap maps the specified
fieldName.public int getSize()
Returns the number of Headers in this
HeaderMap.
Headers in this
HeaderMap.public boolean isEmpty()
true if this HeaderMap contains no
headers.
true if this HeaderMap contains no
headers.
public void putHeader(String fieldName,
String fieldValue)
Maps the specified fieldValue with the specified
fieldName in this HeaderMap. If this
HeaderMap previously contained a mapping for
this fieldName, an additional mapping is created for the
specified fieldValue.
fieldName - the field name with which the specified
fieldValue is to be mapped.fieldValue - the field value to be mapped with the specified
fieldName.putHeader(String, String, boolean)
public void putHeader(String fieldName,
String fieldValue,
boolean replace)
Maps the specified fieldValue with the specified
fieldName in this HeaderMap. If the specified
replace boolean equals true, any previous
mappings for this fieldName will be removed, otherwise an
additional mapping is created for the specified
fieldValue.
fieldName - the field name with which the specified
fieldValue is to be mapped.fieldValue - the field value to be mapped with the specified
fieldName.replace - if set to true, this fieldName
mapping replaces all previous mappings to
fieldName.putHeader(String, String)public void removeHeader(int index)
Removes the mapping at the specified index from this
HeaderMap if present.
index - the index of the mapping to be removed from this
HeaderMap.public void removeHeaders(String fieldName)
Removes all mappings for the specified fieldName from
this HeaderMap if one is present.
fieldName - the field name whose mappings are to be removed from this
HeaderMap.public String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||