Package org.sonar.java.collections
Interface PMap<K,V>
- Type Parameters:
K- the type of keys maintained by this mapV- the type of mapped values
public interface PMap<K,V>
Persistent (functional) Map.
- Author:
- Evgeny Mandrikov
-
Method Summary
Modifier and TypeMethodDescriptionvoidforEach(BiConsumer<K,V> action)Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.booleanisEmpty()toString()The string representation consists of a list of key-value mappings in the ascending order of hash codes of keys.
-
Method Details
-
put
- Returns:
- new map with added key-value pair, or this if map already contains given key-value pair
-
remove
- Returns:
- new map with removed key, or this if map does not contain given key
-
get
- Returns:
- value associated with given key, or null if not found
-
forEach
Performs the given action for each entry in this map until all entries have been processed or the action throws an exception. -
isEmpty
boolean isEmpty()- Returns:
- true if this map contains no elements
-
toString
String toString()The string representation consists of a list of key-value mappings in the ascending order of hash codes of keys. If two keys have same hash code, then their relative order is arbitrary, but stable.
-