X
- Type of keyY
- Type of valuepublic final class IterableAsMap<X,Y> extends Object implements Map<X,Y>
Map
.
This class should be used very carefully. You must understand that
it will fetch the entire content of the encapsulated Map
on each
method call. It doesn't cache the data anyhow.
If you don't need this Map
to re-fresh its content on every call,
by doing round-trips to the encapsulated iterable, use
StickyMap
.
There is no thread-safety guarantee.
StickyMap
Constructor and Description |
---|
IterableAsMap(Iterable<Map.Entry<X,Y>> list)
Ctor.
|
IterableAsMap(Map.Entry<X,Y>... list)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<X,Y>> |
entrySet() |
Y |
get(Object key) |
boolean |
isEmpty() |
Set<X> |
keySet() |
Y |
put(X key,
Y value) |
void |
putAll(Map<? extends X,? extends Y> list) |
Y |
remove(Object key) |
int |
size() |
Collection<Y> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
@SafeVarargs public IterableAsMap(Map.Entry<X,Y>... list)
list
- List of entriesCopyright © 2017 Cactoos. All rights reserved.