public class MapRepresentation extends Representation implements java.lang.Iterable<java.util.Map.Entry<Representation,Representation>>
key -> value map, mapping representations to representations.| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap<Representation,Representation> |
map
The map represented by this representation.
|
| Constructor and Description |
|---|
MapRepresentation() |
MapRepresentation(java.util.Map<Representation,Representation> map) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
void |
forEach(java.util.function.BiConsumer<Representation,Representation> consumer)
Applies the given consumer function to each key-value pair in this map.
|
void |
forEachRandomlyOrdered(java.util.function.BiConsumer<Representation,Representation> consumer)
Applies the given consumer function to each key-value pair in a random order.
|
java.util.Map<Representation,Representation> |
getMap()
Returns an immutable view of this map.
|
int |
hashCode() |
java.util.Iterator<java.util.Map.Entry<Representation,Representation>> |
iterator()
Returns an iterator over this map's entry set.
|
void |
put(Representation key,
Representation value)
Adds
key -> value to the mapping. |
int |
size()
Returns the number of elements in this map.
|
java.util.stream.Stream<java.util.Map.Entry<Representation,Representation>> |
stream()
Returns a stream with the map's entry set as its source.
|
java.lang.String |
toString() |
bigInt, bytes, list, map, obj, repr, strprotected final java.util.HashMap<Representation,Representation> map
public MapRepresentation()
public MapRepresentation(java.util.Map<Representation,Representation> map)
public void put(Representation key, Representation value)
key -> value to the mapping.
If key previously had another image, the old one is overwrittenpublic java.util.Map<Representation,Representation> getMap()
public java.util.stream.Stream<java.util.Map.Entry<Representation,Representation>> stream()
public java.util.Iterator<java.util.Map.Entry<Representation,Representation>> iterator()
iterator in interface java.lang.Iterable<java.util.Map.Entry<Representation,Representation>>public void forEach(java.util.function.BiConsumer<Representation,Representation> consumer)
consumer - the consumer function to applypublic void forEachRandomlyOrdered(java.util.function.BiConsumer<Representation,Representation> consumer)
consumer - the consumer function to applypublic int size()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object