|
jCookie v0.8b | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--com.sonalb.net.http.Header
Represents the Header of an HTTP Message. An HTTP header usually consists of two major components:
Constructor Summary | |
Header()
Creates an empty Header. |
|
Header(Collection c)
Creates a Header, and populates it with HeaderEntries from input Collection. |
|
Header(String topLine,
Collection c)
Creates a Header with given top-line, and populates it with HeaderEntries from input Collection. |
Method Summary | |
boolean |
add(Object entry)
Ensures that this collection contains the specified element (optional operation). |
boolean |
add(String key,
String value)
Adds the specified key-value pair to this Header. |
Object |
clone()
|
boolean |
containsKey(String s)
Checks whether any header entry exists with given key. |
boolean |
containsValue(String s)
Checks whether any header entry exists with given value. |
Header |
getEntriesForKey(String s)
Returns a Header consisting of all HeaderEntries having given key. |
Header |
getEntriesForValue(String s)
Returns a Header consisting of all HeaderEntries having given value. |
HeaderEntry |
getEntryAt(int index)
Returns the entry at specified index. |
HeaderEntry |
getEntryForKey(String s,
int j)
Returns the HeaderEntry corresponding to the first occurrence of the given key, after specified index (non-inclusive). |
HeaderEntry |
getEntryForValue(String s,
int j)
Returns the HeaderEntry corresponding to the first occurrence of the given value, after specified index (non-inclusive). |
HeaderEntry |
getFirstEntryForKey(String s)
Returns the HeaderEntry corresponding to the first occurrence of the given key. |
HeaderEntry |
getFirstEntryForValue(String s)
Returns the HeaderEntry corresponding to the first occurrence of the given value. |
String |
getHeaderField(int i)
Returns the header value for entry at specified index. |
String |
getHeaderFieldKey(int i)
Returns the header key for entry at specified index. |
String |
getTopLine()
Gets the top-line of this Header. |
boolean |
isEmpty()
Returns true if this collection contains no elements. |
Iterator |
iterator()
Returns an iterator over the elements contained in this collection. |
void |
setTopLine(String topLine)
Sets the top-line of this Header. |
int |
size()
Returns the number of elements in this collection. |
String |
toString()
Returns a string representation of this collection. |
Methods inherited from class java.util.AbstractCollection |
addAll, clear, contains, containsAll, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Constructor Detail |
public Header()
public Header(Collection c)
c
- the Collection containing HeaderEntry objectspublic Header(String topLine, Collection c)
c
- the Collection containing HeaderEntry objectstopLine
- the top-most line in an HTTP HeaderMethod Detail |
public void setTopLine(String topLine)
topLine
- the top-most line in an HTTP Headerpublic String getTopLine()
public boolean add(String key, String value)
public HeaderEntry getEntryAt(int index)
public String getHeaderFieldKey(int i)
public String getHeaderField(int i)
public boolean containsKey(String s)
public boolean containsValue(String s)
public HeaderEntry getFirstEntryForKey(String s)
public HeaderEntry getFirstEntryForValue(String s)
public HeaderEntry getEntryForKey(String s, int j)
public HeaderEntry getEntryForValue(String s, int j)
public Header getEntriesForKey(String s)
public Header getEntriesForValue(String s)
public boolean add(Object entry)
AbstractCollection
This implementation always throws an UnsupportedOperationException.
add
in class AbstractCollection
java.util.AbstractCollection
o
- element whose presence in this collection is to be ensured.UnsupportedOperationException
- if the add method is not
supported by this collection.NullPointerException
- if this collection does not permit
null elements, and the specified element is
null.ClassCastException
- if the class of the specified element
prevents it from being added to this collection.IllegalArgumentException
- if some aspect of this element
prevents it from being added to this collection.public Iterator iterator()
AbstractCollection
iterator
in class AbstractCollection
java.util.AbstractCollection
public int size()
AbstractCollection
size
in class AbstractCollection
java.util.AbstractCollection
public String toString()
AbstractCollection
This implementation creates an empty string buffer, appends a left square bracket, and iterates over the collection appending the string representation of each element in turn. After appending each element except the last, the string ", " is appended. Finally a right bracket is appended. A string is obtained from the string buffer, and returned.
toString
in class AbstractCollection
java.util.AbstractCollection
public boolean isEmpty()
AbstractCollection
This implementation returns size() == 0.
isEmpty
in class AbstractCollection
java.util.AbstractCollection
public Object clone() throws CloneNotSupportedException
|
Copyright (c) 2001-2002 Sonal Bansal | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |