org.pcollections.PMap Maven / Gradle / Ivy
/*
* Copyright (c) 2008 Harold Cooper. All rights reserved.
* Licensed under the MIT License.
* See LICENSE file in the project root for full license information.
*/
package org.pcollections;
import java.util.Collection;
import java.util.Map;
/**
* An immutable, persistent map from non-null keys of type K to non-null values of type V.
*
* @author harold
* @param
* @param
*/
public interface PMap extends Map {
/**
* @param key non-null
* @param value non-null
* @return a map with the mappings of this but with key mapped to value
*/
public PMap plus(K key, V value);
/**
* @param map
* @return this combined with map, with map's mappings used for any keys in both map and this
*/
public PMap plusAll(Map extends K, ? extends V> map);
/**
* @param key
* @return a map with the mappings of this but with no value for key
*/
public PMap minus(Object key);
/**
* @param keys
* @return a map with the mappings of this but with no value for any element of keys
*/
public PMap minusAll(Collection> keys);
@Deprecated
V put(K k, V v);
@Deprecated
V remove(Object k);
@Deprecated
void putAll(Map extends K, ? extends V> m);
@Deprecated
void clear();
}