001 package toolbus.environment;
002
003 import java.util.List;
004
005 /**
006 * The Bindings interface maintains (at least conceptually) a list of Bindings. Newer bindings
007 * appear at the begiing of the list.
008 */
009 interface Bindings{
010
011 /**
012 * @return deep (**** qualify this !!! ****) copy of the Bindings object
013 */
014 Bindings clone();
015
016 int size();
017
018 /**
019 * Return the first binding of for a given key value
020 *
021 * @param key
022 * @return its binding or null
023 */
024 Binding get(String key);
025
026 /**
027 * Introduce a new (key, binding) pair
028 *
029 * @param key
030 * @param binding
031 */
032 void put(String key, Binding binding);
033
034 /**
035 * Remove the first binding for key
036 *
037 * @param key
038 */
039 void remove(String key);
040
041 /**
042 * Returns a copy of the content of the bindings as a list.
043 * @return A copy of the content of the bindings as a list.
044 */
045 List<Binding> getBindingsAsList();
046
047 /**
048 * @return a string representation
049 */
050 String toString();
051 }