BiVariable type object.
This map does not permit null or empty key. Each operation of this class is not
synchronized; however, concurrent access to values are synchronized. When
ScriptingContainer is shared by multiple threads, specify thread safe
for a local context scope, which makes a map thread local.
Usage example:
ScriptingContainer container = new ScriptingContainer();
Map map = container.getVarMap();
map.put("@coefficient", new Float(3.14));
or, using a shortcut method:
ScriptingContainer container = new ScriptingContainer();
container.put("@coefficient", new Float(3.14));
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final LocalContextProvider | |
| private List | |
| private List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public void | |
| public boolean | Returns: true if this map contains a mapping for the specified keyis a key to be tested its presence key)Implements java. Returns |
| public boolean | Returns: Returnstrue if this map maps one or more keys to the
specified value.is a Java object to be tested it presence value)Implements java. Returns |
| public Set | Returns: an entry set of a mapImplements java. Returns a |
| public Object | Returns: the value in simple Java object to which the specified key is mapped, ornull if this map contains no mapping for the keyis the key whose associated value is to be returned key)Implements java. Returns the value in simple Java object to which the specified key is mapped,
or |
| public Object | Returns: the value in simple Java object to which the specified key is mapped, ornull if this map contains no mapping for the keyis a receiver object to get the value from receiver, Object is the key whose associated value is to be returned key)Returns the value in simple Java object to which the specified receiver
and key is mapped, or |
| public LocalVariableBehavior | |
| public String[] | Returns: String array of Ruby's local variable namesReturns Ruby's local variable names this map has. |
| public IRubyObject[] | Returns: IRubyObject array of Ruby's local variable names.Returns Ruby's local variable values this map has. |
| public Map | Returns: a Map of key and value pair, in which values are simple Java objects.Returns a map whose value is a Java object not a BiVariable type object. |
| public List | |
| private RubyObject | |
| public Ruby | |
| private RubyObject | |
| public BiVariable | Returns: the BiVariable type object to which the specified key is mapped, ornull if this map contains no mapping for the keyis the key whose associated BiVariable object is to be returned name)Returns the value in BiVariable type to which the specified key is mapped,
or |
| public BiVariable | Returns: the BiVariable type object to which the specified key is mapped, ornull if this map contains no mapping for the keyis a receiver object to get key-value pair from receiver, final String is the key whose associated BiVariable object is to be returned name)Returns the value in BiVariable type to which the specified key is mapped,
or |
| public List | |
| pack-priv void | |
| public boolean | Returns: true if this map contains no key-value mappingsImplements java. Returns |
| public boolean | Returns: true for eager retrieve, false for on-demand retrievalReturns true when eager retrieval is required or false when eager retrieval is unnecessary. |
| public Set | Returns: a set view of the keys contained in this mapImplements java. Returns a |
| private static BiVariable | newVariable(final RubyObject receiver, final String name, final IRubyObject value, final Class<? extends BiVariable> type)
|
| public Object | Returns: the previous value associated withkey, or
null if there was no mapping for key.the key with which the specified value is to be associated key, Object a simple Java object to be associated with the specified key value)Implements java. Associates the specified value with the specified key in this map. |
| public Object | Returns: the previous value associated withkey, or
null if there was no mapping for key.a receiver object to associate a given key-value pair with receiver, String the key with which the specified value is to be associated key, Object a simple Java object to be associated with the specified key value)Associates the specified value with the specified key in this map. |
| public void | putAll(final Map<? extends String, ? extends Object>
mappings to be stored in this map map)Implements java. Copies all of the mappings from the specified map to this map. |
| public Object | Returns: the previous value associated withkey, or
null if there was no mapping for key.the key whose mapping is to be removed from the map key)Implements java. Removes the mapping for a key from this map if it is present in a top level. |
| public Object | Returns: the previous value associated withkey, or
null if there was no mapping for key.the key whose mapping is to be removed from the map key)Removes the mapping for a key from this map if it is present in a given receiver. |
| pack-priv void | |
| public void | |
| public void | |
| public int | Returns: the number of key-value mappings in this mapImplements java. Returns the number of key-value mappings in this map. |
| pack-priv void | |
| public String | |
| public void | update(final String
is a Ruby's local variable name name, final BiVariable is BiVariable type object corresponding to the name value)Adds a key-value pair of Ruby local variable to double array. |
| public void | updateVariable(final RubyObject receiver, final String name, final IRubyObject value, final Class<? extends BiVariable> type)
|
| public Collection | Returns: a collection view of the values contained in this mapImplements java. Returns a |
| lazy | back to summary |
|---|---|
| private final boolean lazy | |
| provider | back to summary |
|---|---|
| private final LocalContextProvider provider | |
| variables | back to summary |
|---|---|
| private List<BiVariable> variables | |
| varNames | back to summary |
|---|---|
| private List<String> varNames | |
| BiVariableMap | back to summary |
|---|---|
| public BiVariableMap(LocalContextProvider provider, boolean lazy) Constructs an empty map. Users do not instantiate this map. The map is created internally. | |
| checkKey | back to summary |
|---|---|
| private static String checkKey(final Object key) | |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Removes all of the mappings from this map. The map will be empty after this call returns. Ruby variables are also removed from Ruby instance. However, Ruby instance keep having global variable names with null value.
| |
| containsKey | back to summary |
|---|---|
| public boolean containsKey(final Object key) Implements java. Returns | |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(final Object value) Implements java. Returns | |
| entrySet | back to summary |
|---|---|
| public Set Implements java. Returns a | |
| get | back to summary |
|---|---|
| public Object get(Object key) Implements java. Returns the value in simple Java object to which the specified key is mapped,
or | |
| get | back to summary |
|---|---|
| public Object get(Object receiver, Object key) Returns the value in simple Java object to which the specified receiver
and key is mapped, or | |
| getLocalVariableBehavior | back to summary |
|---|---|
| public LocalVariableBehavior getLocalVariableBehavior() Returns a local variable behavior
| |
| getLocalVarNames | back to summary |
|---|---|
| public String[] getLocalVarNames() Returns Ruby's local variable names this map has. The returned array is mainly used to inject local variables to Ruby scripts while parsing.
| |
| getLocalVarValues | back to summary |
|---|---|
| public IRubyObject[] getLocalVarValues() Returns Ruby's local variable values this map has. The returned array is mainly used to inject local variables to Ruby scripts while evaluating.
| |
| getMap | back to summary |
|---|---|
| public Map Returns a map whose value is a Java object not a BiVariable type object. | |
| getNames | back to summary |
|---|---|
| public List Returns a list of all names in this map. | |
| getReceiverObject | back to summary |
|---|---|
| private RubyObject getReceiverObject(final Object receiver) | |
| getRuntime | back to summary |
|---|---|
| public Ruby getRuntime() | |
| getTopSelf | back to summary |
|---|---|
| private RubyObject getTopSelf() | |
| getVariable | back to summary |
|---|---|
| public BiVariable getVariable(final String name) Returns the value in BiVariable type to which the specified key is mapped,
or
| |
| getVariable | back to summary |
|---|---|
| public BiVariable getVariable(final RubyObject receiver, final String name) Returns the value in BiVariable type to which the specified key is mapped,
or
| |
| getVariables | back to summary |
|---|---|
| public List Returns a list of all values in this map.
| |
| inject | back to summary |
|---|---|
| pack-priv void inject(final DynamicScope scope) | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Returns
| |
| isLazy | back to summary |
|---|---|
| public boolean isLazy() Returns true when eager retrieval is required or false when eager retrieval is unnecessary.
| |
| keySet | back to summary |
|---|---|
| public Set Implements java. Returns a | |
| newVariable | back to summary |
|---|---|
| private static BiVariable newVariable(final RubyObject receiver, final String name, final IRubyObject value, final Class<? extends BiVariable> type) | |
| put | back to summary |
|---|---|
| public Object put(String key, Object value) Implements java. Associates the specified value with the specified key in this map. The values is a simple Java object. If the map previously contained a mapping for the key, the old value is replaced by the specified value. | |
| put | back to summary |
|---|---|
| public Object put(Object receiver, String key, Object value) Associates the specified value with the specified key in this map. The values is a simple Java object. If the map previously contained a mapping for the key, the old value is replaced by the specified value.
| |
| putAll | back to summary |
|---|---|
| public void putAll(final Map<? extends String, ? extends Object> map) Implements java. Copies all of the mappings from the specified map to this map. | |
| remove | back to summary |
|---|---|
| public Object remove(final Object key) Implements java. Removes the mapping for a key from this map if it is present in a top level. Returns the value to which this map previously associated the key,
or | |
| removeFrom | back to summary |
|---|---|
| public Object removeFrom(final Object receiver, final Object key) Removes the mapping for a key from this map if it is present in a given receiver. Returns the value to which this map previously associated the key,
or | |
| retrieve | back to summary |
|---|---|
| pack-priv void retrieve(final IRubyObject receiver) | |
| setVariable | back to summary |
|---|---|
| public void setVariable(BiVariable var) | |
| setVariable | back to summary |
|---|---|
| public void setVariable(final RubyObject receiver, final BiVariable var) | |
| size | back to summary |
|---|---|
| public int size() Implements java. Returns the number of key-value mappings in this map.
| |
| terminate | back to summary |
|---|---|
| pack-priv void terminate() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| update | back to summary |
|---|---|
| public void update(final String name, final BiVariable value) Adds a key-value pair of Ruby local variable to double array.
| |
| updateVariable | back to summary |
|---|---|
| public void updateVariable(final RubyObject receiver, final String name, final IRubyObject value, final Class<? extends BiVariable> type) | |
| values | back to summary |
|---|---|
| public Collection Implements java. Returns a
| |