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

org.pcollections.PMap Maven / Gradle / Ivy

There is a newer version: 3.3.8
Show newest version
/*
 * 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 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 m);

  @Deprecated
  void clear();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy