All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sri.ai.util.collect.MapWrapper Maven / Gradle / Ivy

package com.sri.ai.util.collect;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

/**
 * A Map that wraps a given map. Useful as a basis for classes that need to modify certain behaviors of a given map.
 */
public class MapWrapper implements Map {

	private Map map;
	
	public MapWrapper(Map map) {
		this.map = map;
	}
	
	@Override
	public void clear() {
		map.clear();
	}

	@Override
	public boolean containsKey(Object arg0) {
		return map.containsKey(arg0);
	}

	@Override
	public boolean containsValue(Object arg0) {
		return map.containsValue(arg0);
	}

	@Override
	public Set> entrySet() {
		return map.entrySet();
	}

	@Override
	public V get(Object arg0) {
		return map.get(arg0);
	}

	@Override
	public boolean isEmpty() {
		return map.isEmpty();
	}

	@Override
	public Set keySet() {
		return map.keySet();
	}

	@Override
	public V remove(Object arg0) {
		return map.remove(arg0);
	}

	@Override
	public int size() {
		return map.size();
	}

	@Override
	public V put(K key, V value) {
		return map.put(key, value);
	}

	@Override
	public void putAll(Map m) {
		map.putAll(m);
	}

	@Override
	public Collection values() {
		return map.values();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy