|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
org.eclipse.osgi.framework.util.Headers<K,V>
public class Headers<K,V>
Headers classes. This class implements a Dictionary that has the following behavior:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
Headers(Dictionary<? extends K,? extends V> values)
Create a Headers dictionary from a Dictionary. |
|
Headers(int initialCapacity)
Create an empty Headers dictionary. |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Enumeration<V> |
elements()
Values. |
Set<Map.Entry<K,V>> |
entrySet()
|
V |
get(Object key)
Support case-insensitivity for keys. |
boolean |
isEmpty()
Tests if this dictionary maps no keys to value. |
Enumeration<K> |
keys()
Case-preserved keys. |
Set<K> |
keySet()
|
static Headers<String,String> |
parseManifest(InputStream in)
|
V |
put(K key,
V value)
Always throws UnsupportedOperationException. |
void |
putAll(Map<? extends K,? extends V> c)
|
V |
remove(Object key)
Always throws UnsupportedOperationException. |
V |
set(K key,
V value)
Set a header value. |
V |
set(K key,
V value,
boolean replace)
Set a header value or optionally replace it if it already exists. |
void |
setReadOnly()
|
int |
size()
Returns the number of entries (distinct keys) in this dictionary. |
String |
toString()
|
Collection<V> |
values()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public Headers(int initialCapacity)
initialCapacity - The initial capacity of this Headers object.public Headers(Dictionary<? extends K,? extends V> values)
values - The initial dictionary for this Headers object.
IllegalArgumentException - If a case-variant of the key is
in the dictionary parameter.| Method Detail |
|---|
public Enumeration<K> keys()
keys in class Dictionary<K,V>public Enumeration<V> elements()
elements in class Dictionary<K,V>public V get(Object key)
get in interface Map<K,V>get in class Dictionary<K,V>key - name.
public V set(K key,
V value,
boolean replace)
key - Key name.value - Value of the key or null to remove key.replace - A value of true will allow a previous
value of the key to be replaced. A value of false
will cause an IllegalArgumentException to be thrown
if a previous value of the key exists.
IllegalArgumentException - If a case-variant of the key is
already present.
public V set(K key,
V value)
key - Key name.value - Value of the key or null to remove key.
IllegalArgumentException - If a case-variant of the key is
already present.public void setReadOnly()
public int size()
size in interface Map<K,V>size in class Dictionary<K,V>public boolean isEmpty()
isEmpty in interface Map<K,V>isEmpty in class Dictionary<K,V>true if this dictionary maps no keys to values;
false otherwise.
public V put(K key,
V value)
put in interface Map<K,V>put in class Dictionary<K,V>key - header name.value - header value.
UnsupportedOperationExceptionpublic V remove(Object key)
remove in interface Map<K,V>remove in class Dictionary<K,V>key - header name.
UnsupportedOperationExceptionpublic String toString()
toString in class Object
public static Headers<String,String> parseManifest(InputStream in)
throws BundleException
BundleExceptionpublic void clear()
clear in interface Map<K,V>public boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K,V>public Set<K> keySet()
keySet in interface Map<K,V>public void putAll(Map<? extends K,? extends V> c)
putAll in interface Map<K,V>public Collection<V> values()
values in interface Map<K,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||