### javax.script

# Class SimpleBindings

- `java.lang.Object`

- `javax.script.SimpleBindings`

Implemented Interfaces:
  Bindings, java.util.Map

`public class SimpleBindings`
`extends java.lang.Object`
`implements Bindings`

SimpleNamespace is an implementation of Namespace using an instance of java.util.HashMap or another Map passed in a constructor to store and expose key-pair values.

Authors:
  Nandika Jayawardana <nandika@opensource.lk>
  Sanka Samaranayake <sanka@opensoruce.lk>

## Nested Class Summary

## Constructor Summary

`SimpleBindings()`
  Constructs a SimpleNamespace.

`SimpleBindings(java.util.Map map)`
  Constructs a SimpleNamespace and initializes it using a specified map.

## Method Summary

`void`

`clear()`

`boolean`

`containsKey(java.lang.Object key)`

`boolean`

`containsValue(java.lang.Object value)`

`java.util.Set`

`entrySet()`

`java.lang.Object`

`get(java.lang.Object key)`

`boolean`

`isEmpty()`

`java.util.Set`

`keySet()`

`java.lang.Object`

`put(java.lang.Object key, java.lang.Object value)`
  Associates the specified value with the specified key in a java.util.Map.

`void`

`putAll(java.util.Map toMerge)`
  Copies all of the mappings from the specified map to this map.

`java.lang.Object`

`remove(java.lang.Object key)`

`int`

`size()`

`java.util.Collection`

`values()`

### Methods inherited from class java.lang.Object

`equals`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Constructor Details

### SimpleBindings

    public SimpleBindings()

> Constructs a SimpleNamespace.

### SimpleBindings

    public SimpleBindings(java.util.Map map)

> Constructs a SimpleNamespace and initializes it using a specified map.

> Parameters:
>   `map` - a map which is used to initialize the SimpleNamespace

## Method Details

### clear

    public void clear()

> Specified by:
>   clear in interface java.util.Map

### containsKey

    public boolean containsKey(java.lang.Object key)

> Specified by:
>   containsKey in interface java.util.Map

### containsValue

    public boolean containsValue(java.lang.Object value)

> Specified by:
>   containsValue in interface java.util.Map

### entrySet

    public java.util.Set entrySet()

> Specified by:
>   entrySet in interface java.util.Map

### get

    public java.lang.Object get(java.lang.Object key)

> Specified by:
>   get in interface java.util.Map

### isEmpty

    public boolean isEmpty()

> Specified by:
>   isEmpty in interface java.util.Map

### keySet

    public java.util.Set keySet()

> Specified by:
>   keySet in interface java.util.Map

### put

    public java.lang.Object put(java.lang.Object key,
                                java.lang.Object value)
                throws java.lang.IllegalArgumentException

> Associates the specified value with the specified key in a java.util.Map. If the map previously contained a mapping for this key, the old value is replaced.
> Specified by:
>   put in interface Bindings
>   put in interface java.util.Map

> Parameters:
>   `key` - the String value which uniquely identifies the object
>   `value` - the object to be stored.

> Throws:
>   `java.lang.IllegalArgumentException` - if the key is null or is not java.lang.String type

### putAll

    public void putAll(java.util.Map toMerge)
                throws java.lang.IllegalArgumentException

> Copies all of the mappings from the specified map to this map. These mappings will replace any mappings that this map had for any of the keys currently in the specified map.
> Specified by:
>   putAll in interface Bindings
>   putAll in interface java.util.Map

> Parameters:
>   `toMerge` - mappings to be stored in the map.

> Throws:
>   `java.lang.IllegalArgumentException` - if a key is null or is not java.lang.String type in the specified map

### remove

    public java.lang.Object remove(java.lang.Object key)

> Specified by:
>   remove in interface java.util.Map

### size

    public int size()

> Specified by:
>   size in interface java.util.Map

### values

    public java.util.Collection values()

> Specified by:
>   values in interface java.util.Map