|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- V
- @Immutable public interface JImmutableMap<K,V>
Interface for persistent data structures that allow storage and retrieval of key/value pairs. null is always an allowed value within the map but is not an allowed key.
Nested Class Summary | |
---|---|
static interface |
JImmutableMap.Entry<K,V>
An immutable entry in the map. |
Method Summary | |
---|---|
JImmutableMap<K,V> |
assign(K key,
V value)
Sets the value associated with a specific key. |
JImmutableMap<K,V> |
delete(K key)
Deletes the entry for the specified key (if any). |
JImmutableMap<K,V> |
deleteAll()
|
Holder<V> |
find(K key)
Search for a value within the map and return a Holder indicating if the value was found and, if it was found, the value itself. |
Holder<JImmutableMap.Entry<K,V>> |
findEntry(K key)
Search for an Entry within the map and return a Holder indicating if the Entry was found and, if it was found, the Entry itself. |
Map<K,V> |
getMap()
Creates an unmodifiable java.util.Map reflecting the values of this PersistentMap. |
Insertable<JImmutableMap.Entry<K,V>> |
insert(JImmutableMap.Entry<K,V> value)
Add key/value entry to the map, replacing any existing entry with same key. |
boolean |
isEmpty()
|
Cursor<K> |
keysCursor()
Creates a Cursor to access all of the Map's keys. |
int |
size()
Return the number of entries in the map. |
Cursor<V> |
valuesCursor()
Creates a Cursor to access all of the Map's values. |
Methods inherited from interface org.javimmutable.collections.Mapped |
---|
get, getValueOr |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Methods inherited from interface org.javimmutable.collections.Cursorable |
---|
cursor |
Method Detail |
---|
@Nonnull Insertable<JImmutableMap.Entry<K,V>> insert(@Nonnull JImmutableMap.Entry<K,V> value)
insert
in interface Insertable<JImmutableMap.Entry<K,V>>
value
-
@Nonnull Holder<V> find(@Nonnull K key)
find
in interface Mapped<K,V>
key
- non-null key to search for
@Nonnull Holder<JImmutableMap.Entry<K,V>> findEntry(@Nonnull K key)
key
- non-null key to search for
@Nonnull JImmutableMap<K,V> assign(@Nonnull K key, V value)
key
- non-null keyvalue
- possibly null value
@Nonnull JImmutableMap<K,V> delete(@Nonnull K key)
key
- non-null key
int size()
boolean isEmpty()
@Nonnull JImmutableMap<K,V> deleteAll()
@Nonnull Map<K,V> getMap()
@Nonnull Cursor<K> keysCursor()
@Nonnull Cursor<V> valuesCursor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |