public interface WebStorage
| Modifier and Type | Method and Description |
|---|---|
boolean |
clear()
Removes all key/value pairs in the storage.
删除存储中的所有键/值对。 |
boolean |
contains(java.lang.String key)
Returns
如果存储包含指定的键,则返回true;否则返回false。 true if storage contains specified
key or
false otherwise.
|
java.lang.String |
getItem(java.lang.String key)
Returns the value associated with the given
返回与给定键关联的值;如果键不存在,则返回null。 key or
null when the
key doesn't exist.
|
java.lang.String |
key(long index)
Returns the name of the key in the storage.
返回存储中键的名称。 |
long |
length()
Returns number of key/value pairs in the storage.
返回存储中键/值对的数量。 |
boolean |
removeItem(java.lang.String key)
Removes key/value pair from the storage.
从存储中删除键/值对。 |
boolean |
setItem(java.lang.String key, java.lang.String value)
Adds the
将密钥和值添加到存储中,或更新密钥的值(如果已存在)。 key and
value to the storage, or updates key's value if it already exists.
|
long length()
java.lang.String key(long index)
index - an integer representing the number of the key you want to get the name of. This is a zero-based index. Must be in range
0 < index < length().
-一个整数,代表要获取名称的键的编号。这是从零开始的索引。必须在范围内。
null.
包含键或名称的字符串。
java.lang.IllegalArgumentException - when the
index isn't in
0 < index < length() range.
java.lang.String getItem(java.lang.String key)
key or
null when the
key doesn't exist.
key - the name of the key you want to retrieve the value of. Cannot be
null.
-要检索其值的键的名称。不可能是 。
key or
null when the
key doesn't exist.
与给定或不存在的值关联的值。
java.lang.IllegalArgumentException - when the
key is
null.
boolean setItem(java.lang.String key,
java.lang.String value)
key and
value to the storage, or updates key's value if it already exists.
key - the name of the key you want to create/update. Cannot be
null.
-您要创建/更新的密钥的名称。不可能是 。
value - the value you want to give the key you are creating/updating. Cannot be
null.
-您要提供要创建/更新的密钥的值。不可能是 。
true if key/value pair was successfully added or updated. Returns
false in case of exceptions.
键/值对是否已成功添加或更新。在有异常的情况下返回。
java.lang.IllegalArgumentException - when the
key or
value is
null.
boolean removeItem(java.lang.String key)
key - the name of the key you want to remove. Cannot be
null.
-您要删除的密钥的名称。不可能是 。
true if key/value pair was successfully removed, or key doesn't exist. Returns
false in case of exceptions.
如果键/值对已成功删除,或者键不存在。在有异常的情况下返回。
java.lang.IllegalArgumentException - when the
key is
null.
boolean clear()
true if storage was successfully cleared. Returns
false in case of exceptions or storage was not initialized.
是否成功清除存储。如果发生异常或未初始化存储,则返回。
boolean contains(java.lang.String key)
true if storage contains specified
key or
false otherwise.
key - the name of the key you want to check. Cannot be
null.
-您要检查的密钥的名称。不可能是 。
true if storage contains specified
key or
false otherwise.
是否包含指定的存储空间。
java.lang.IllegalArgumentException - when the
key is
null.