01: /*
02: * %W% %E% %U%
03: *
04: * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
05: * SUN PROPRIETARY/CONFIDENTAIL. Use is subject to license terms.
06: */
07:
08: package javax.script;
09:
10: import java.util.Map;
11:
12: /**
13: * A mapping of key/value pairs, all of whose keys are
14: * <code>Strings</code>.
15: *
16: * @version 1.0
17: * @author Mike Grogan
18: * @since 1.6
19: */
20: public interface Bindings extends Map<String, Object> {
21: /**
22: * Set a named value.
23: *
24: * @param name The name associated with the value.
25: * @param value The value associated with the name.
26: *
27: * @return The value previously associated with the given name.
28: * Returns null if no value was previously associated with the name.
29: *
30: * @throws <code>NullPointerException</code> if the name is null.
31: * @throws <code>IllegalArgumentException</code> if the name is empty String.
32: */
33: public Object put(String name, Object value);
34:
35: /**
36: * Adds all the mappings in a given <code>Map</code> to this <code>Bindings</code.
37: * @param toMerge The <code>Map</code> to merge with this one.
38: *
39: * @throws <code>NullPointerException</code> if some key in the map is null.
40: * @throws <code>IllegalArgumentException</code> if some key in the map is an empty String.
41: */
42: public void putAll(Map<? extends String, ? extends Object> toMerge);
43: }
|