1 /* 2 * Copyright 2010 Daniel Kurka 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16 package com.googlecode.mgwt.collection.shared; 17 18 /** 19 * 20 * A lightmap is a key value store that uses a native implementation if available. 21 * 22 * @author Daniel Kurka 23 * 24 * @param <V> the type of object to store 25 */ 26 public interface LightMap<V> { 27 28 /** 29 * remove all objects from this map 30 */ 31 public void clear(); 32 33 /** 34 * does the map contain a key 35 * 36 * @param key the key to test for 37 * @return true if the key is part of the map 38 */ 39 public boolean containsKey(String key); 40 41 /** 42 * get all keys for this map 43 * 44 * @return the keys of this map 45 */ 46 public LightArray<String> getKeys(); 47 48 /** 49 * remove a value from the map 50 * 51 * @param key 52 */ 53 public void remove(String key); 54 55 /** 56 * get a value from the map 57 * 58 * @param key the key to use 59 * @return the value 60 */ 61 public V get(String key); 62 63 /** 64 * put a value into the map 65 * 66 * @param key the key 67 * @param value the value 68 */ 69 public void put(String key, V value); 70 }