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

com.github.krukow.clj_ds.PersistentMap Maven / Gradle / Ivy

The newest version!
package com.github.krukow.clj_ds;

import java.util.Map;

/**
 * {@link PersistentMap}s
 * 
 * @param 
 *            The type of the keys
 * @param 
 *            The type of the values
 */
public interface PersistentMap extends Map {

	/**
	 * @return An empty instance of this kind of {@link PersistentMap}
	 */
	PersistentMap zero();

	/**
	 * @return A new {@link PersistentMap} consisting of the content of the
	 *         current {@link PersistentMap} where the given key is associated
	 *         to the value val. The new association may replace a previous
	 *         association.
	 */
	PersistentMap plus(K key, V val);

	/**
	 * @return A new {@link PersistentMap} consisting of the content of the
	 *         current {@link PersistentMap} where the given key is associated
	 *         to the value val.
	 * @throws java.lang.RuntimeException
	 *             If the key is already present in the {@link PersistentMap}.
	 */
	PersistentMap plusEx(K key, V val);

	/**
	 * @return A new {@link PersistentMap} consisting of the content of the
	 *         current {@link PersistentMap} without the assocation to the given
	 *         key.
	 */
	PersistentMap minus(K key);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy