Top Description Methods
org.pcollections

public Interface PMap<K, V>

extends Map<K, V>
Known Direct Subinterfaces
org.pcollections.PSortedMap
Known Direct Implementers
org.pcollections.HashPMap, org.pcollections.IntTreePMap, org.pcollections.OrderedPMap
Imports
java.util.Collection, .Map

An immutable, persistent map from keys of type K to values of type V.

Some implementations may not support null keys and/or values, in which case they will throw NullPointerException for attempts to add such keys/values.

Author
harold

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Redeclares java.util.Map.clear.

Deprecated

Removes all of the mappings from this map (optional operation).

public PMap<K, V>

Returns:

a map with the mappings of this but with no value for key
minus
(Object key)

public PMap<K, V>

Returns:

a map with the mappings of this but with no value for any element of keys
minusAll
(Collection<?> keys)

public PMap<K, V>

Returns:

a map with the mappings of this but with key mapped to value
plus
(K key, V value)

public PMap<K, V>

Returns:

this combined with map, with map's mappings used for any keys in both map and this
plusAll
(Map<? extends K, ? extends V> map)

public V
put(K
key with which the specified value is to be associated
k
,
V
value to be associated with the specified key
v
)

Redeclares java.util.Map.put.

Deprecated

Associates the specified value with the specified key in this map (optional operation).

public void
putAll(Map<? extends K, ? extends V>
mappings to be stored in this map
m
)

Redeclares java.util.Map.putAll.

Deprecated

Copies all of the mappings from the specified map to this map (optional operation).

public V
remove(Object
key whose mapping is to be removed from the map
k
)

Redeclares java.util.Map.remove.

Deprecated

Removes the mapping for a key from this map if it is present (optional operation).

Inherited from java.util.Map:
computecomputeIfAbsentcomputeIfPresentcontainsKeycontainsValuecopyOfentryentrySetequalsforEachgetgetOrDefaulthashCodeisEmptykeySetmergeofofofofofofofofofofofofEntriesputIfAbsentremovereplacereplacereplaceAllsizevalues

Method Detail

clearback to summary
public void clear()

Redeclares java.util.Map.clear.

Doc from java.util.Map.clear.

Deprecated

Removes all of the mappings from this map (optional operation). The map will be empty after this call returns.

Annotations
@Deprecated
minusback to summary
public PMap<K, V> minus(Object key)
Returns:PMap<K, V>

a map with the mappings of this but with no value for key

minusAllback to summary
public PMap<K, V> minusAll(Collection<?> keys)
Returns:PMap<K, V>

a map with the mappings of this but with no value for any element of keys

plusback to summary
public PMap<K, V> plus(K key, V value)
Returns:PMap<K, V>

a map with the mappings of this but with key mapped to value

plusAllback to summary
public PMap<K, V> plusAll(Map<? extends K, ? extends V> map)
Returns:PMap<K, V>

this combined with map, with map's mappings used for any keys in both map and this

putback to summary
public V put(K k, V v)

Redeclares java.util.Map.put.

Doc from java.util.Map.put.

Deprecated

Associates the specified value with the specified key in this map (optional operation). If the map previously contained a mapping for the key, the old value is replaced by the specified value. (A map m is said to contain a mapping for a key k if and only if m.containsKey(k) would return true.)

Parameters
k:K

key with which the specified value is to be associated

v:V

value to be associated with the specified key

Returns:V

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

Annotations
@Deprecated
putAllback to summary
public void putAll(Map<? extends K, ? extends V> m)

Redeclares java.util.Map.putAll.

Doc from java.util.Map.putAll.

Deprecated

Copies all of the mappings from the specified map to this map (optional operation). The effect of this call is equivalent to that of calling put(k, v) on this map once for each mapping from key k to value v in the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress. If the specified map has a defined encounter order, processing of its mappings generally occurs in that order.

Parameters
m:Map<? extends K, ? extends V>

mappings to be stored in this map

Annotations
@Deprecated
removeback to summary
public V remove(Object k)

Redeclares java.util.Map.remove.

Doc from java.util.Map.remove.

Deprecated

Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

Parameters
k:Object

key whose mapping is to be removed from the map

Returns:V

the previous value associated with key, or null if there was no mapping for key.

Annotations
@Deprecated