Package org.apache.pivot.web
Class QueryDictionary
- java.lang.Object
-
- org.apache.pivot.web.QueryDictionary
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.String>,Dictionary<java.lang.String,java.lang.String>
public final class QueryDictionary extends java.lang.Object implements Dictionary<java.lang.String,java.lang.String>, java.lang.Iterable<java.lang.String>
Represents a collection of keyed data associated with a query. Allows multiple values to be set against a given key.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Dictionary
Dictionary.Pair<K,V>
-
-
Constructor Summary
Constructors Constructor Description QueryDictionary(boolean caseSensitiveKeys)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intadd(java.lang.String key, java.lang.String value)voidclear()booleancontainsKey(java.lang.String key)Tests the existence of a key in the dictionary.java.lang.Stringget(java.lang.String key)Retrieves the value for the given key.java.lang.Stringget(java.lang.String key, int index)intgetLength(java.lang.String key)voidinsert(java.lang.String key, java.lang.String value, int index)java.util.Iterator<java.lang.String>iterator()java.lang.Stringput(java.lang.String key, java.lang.String value)Sets the value of the given key, creating a new entry or replacing the existing value.java.lang.Stringremove(java.lang.String key)Removes a key/value pair from the map.java.lang.Stringremove(java.lang.String key, int index)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.collections.Dictionary
containsAny, copy, getBoolean, getBoolean, getColor, getFirst, getFont, getInt, getInt, getString, getString, putAll
-
-
-
-
Method Detail
-
get
public java.lang.String get(java.lang.String key)
Description copied from interface:DictionaryRetrieves the value for the given key.- Specified by:
getin interfaceDictionary<java.lang.String,java.lang.String>- Parameters:
key- The key whose value is to be returned.- Returns:
- The value corresponding to
key, or null if the key does not exist. Will also return null if the key refers to a null value. UseDictionary.containsKey(K)to distinguish between these two cases.
-
get
public java.lang.String get(java.lang.String key, int index)
-
put
public java.lang.String put(java.lang.String key, java.lang.String value)Description copied from interface:DictionarySets the value of the given key, creating a new entry or replacing the existing value.- Specified by:
putin interfaceDictionary<java.lang.String,java.lang.String>- Parameters:
key- The key whose value is to be set.value- The value to be associated with the given key.- Returns:
- The value previously associated with the key.
-
add
public int add(java.lang.String key, java.lang.String value)
-
insert
public void insert(java.lang.String key, java.lang.String value, int index)
-
remove
public java.lang.String remove(java.lang.String key)
Description copied from interface:DictionaryRemoves a key/value pair from the map.- Specified by:
removein interfaceDictionary<java.lang.String,java.lang.String>- Parameters:
key- The key whose mapping is to be removed.- Returns:
- The value that was removed.
-
remove
public java.lang.String remove(java.lang.String key, int index)
-
clear
public void clear()
-
containsKey
public boolean containsKey(java.lang.String key)
Description copied from interface:DictionaryTests the existence of a key in the dictionary.- Specified by:
containsKeyin interfaceDictionary<java.lang.String,java.lang.String>- Parameters:
key- The key whose presence in the dictionary is to be tested.- Returns:
trueif the key exists in the dictionary;false, otherwise.
-
getLength
public int getLength(java.lang.String key)
-
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.String>
-
-