程序包 com.script
类 SimpleBindings
java.lang.Object
com.script.SimpleBindings
A simple implementation of Bindings backed by
a
HashMap or some other specified Map.- 从以下版本开始:
- 1.6
-
嵌套类概要
-
构造器概要
构造器构造器说明Default constructor uses aHashMap.Constructor uses an existingMapto store the values. -
方法概要
修饰符和类型方法说明voidclear()booleancontainsKey(Object key) Returnstrueif this map contains a mapping for the specified key.booleancontainsValue(Object value) entrySet()Returns the value to which this map maps the specified key.booleanisEmpty()keySet()Sets the specified key/value in the underlyingmapfield.voidputAllis implemented usingMap.putAll.Removes the mapping for this key from this map if it is present (optional operation).intsize()values()从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
构造器详细资料
-
SimpleBindings
Constructor uses an existingMapto store the values.- 参数:
m- TheMapbacking thisSimpleBindings.- 抛出:
NullPointerException- if m is null
-
SimpleBindings
public SimpleBindings()Default constructor uses aHashMap.
-
-
方法详细资料
-
put
Sets the specified key/value in the underlyingmapfield.- 指定者:
put在接口中Bindings- 指定者:
put在接口中Map<String,Object> - 参数:
name- Name of valuevalue- Value to set.- 返回:
- Previous value for the specified key. Returns null if key was previously unset.
- 抛出:
NullPointerException- if the name is null.IllegalArgumentException- if the name is empty.
-
putAll
putAllis implemented usingMap.putAll.- 指定者:
putAll在接口中Bindings- 指定者:
putAll在接口中Map<String,Object> - 参数:
toMerge- TheMapof values to add.- 抛出:
NullPointerException- if toMerge map is null or if some key in the map is null.IllegalArgumentException- if some key in the map is an empty String.
-
clear
public void clear() -
containsKey
Returnstrueif this map contains a mapping for the specified key. More formally, returnstrueif and only if this map contains a mapping for a keyksuch that(key==null ? k==null : key.equals(k)). (There can be at most one such mapping.)- 指定者:
containsKey在接口中Bindings- 指定者:
containsKey在接口中Map<String,Object> - 参数:
key- key whose presence in this map is to be tested.- 返回:
trueif this map contains a mapping for the specified key.- 抛出:
NullPointerException- if key is nullClassCastException- if key is not StringIllegalArgumentException- if key is empty String
-
containsValue
- 指定者:
containsValue在接口中Map<String,Object>
-
entrySet
-
get
Returns the value to which this map maps the specified key. Returnsnullif the map contains no mapping for this key. A return value ofnulldoes not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key tonull. ThecontainsKeyoperation may be used to distinguish these two cases.More formally, if this map contains a mapping from a key
kto a valuevsuch that(key==null ? k==null : key.equals(k)), then this method returnsv; otherwise it returnsnull. (There can be at most one such mapping.)- 指定者:
get在接口中Bindings- 指定者:
get在接口中Map<String,Object> - 参数:
key- key whose associated value is to be returned.- 返回:
- the value to which this map maps the specified key, or
nullif the map contains no mapping for this key. - 抛出:
NullPointerException- if key is nullClassCastException- if key is not StringIllegalArgumentException- if key is empty String
-
isEmpty
public boolean isEmpty() -
keySet
-
remove
Removes the mapping for this key from this map if it is present (optional operation). More formally, if this map contains a mapping from keykto valuevsuch that(key==null ? k==null : key.equals(k)), that mapping is removed. (The map can contain at most one such mapping.)Returns the value to which the map previously associated the key, or
nullif the map contained no mapping for this key. (Anullreturn can also indicate that the map previously associatednullwith the specified key if the implementation supportsnullvalues.) The map will not contain a mapping for the specified key once the call returns.- 指定者:
remove在接口中Bindings- 指定者:
remove在接口中Map<String,Object> - 参数:
key- key whose mapping is to be removed from the map.- 返回:
- previous value associated with specified key, or
nullif there was no mapping for key. - 抛出:
NullPointerException- if key is nullClassCastException- if key is not StringIllegalArgumentException- if key is empty String
-
size
public int size() -
values
-