|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javimmutable.collections.common.AbstractJImmutableMap<K,V>
org.javimmutable.collections.tree.JImmutableTreeMap<K,V>
@Immutable public class JImmutableTreeMap<K,V>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.javimmutable.collections.JImmutableMap |
---|
JImmutableMap.Entry<K,V> |
Method Summary | ||
---|---|---|
JImmutableTreeMap<K,V> |
assign(K key,
V value)
Sets the value associated with a specific key. |
|
Cursor<JImmutableMap.Entry<K,V>> |
cursor()
|
|
JImmutableTreeMap<K,V> |
delete(K key)
Deletes the entry for the specified key (if any). |
|
JImmutableTreeMap<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. |
|
Comparator<K> |
getComparator()
|
|
List<K> |
getKeysList()
|
|
V |
getValueOr(K key,
V defaultValue)
Return the value associated with key or defaultValue if no value is associated. |
|
static
|
of()
|
|
static
|
of(Comparator<K> comparator)
Constructs an empty map using the specified Comparator. |
|
static
|
of(Map<K,V> map)
Constructs a new map containing the same key/value pairs as map using a ComparableComparator to compare the keys. |
|
int |
size()
Return the number of entries in the map. |
|
void |
verifyDepthsMatch()
|
Methods inherited from class org.javimmutable.collections.common.AbstractJImmutableMap |
---|
equals, get, getMap, hashCode, insert, isEmpty, iterator, keysCursor, toString, valuesCursor |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static <K extends Comparable<K>,V> JImmutableTreeMap<K,V> of()
public static <K,V> JImmutableTreeMap<K,V> of(Comparator<K> comparator)
comparator
- public static <K extends Comparable<K>,V> JImmutableTreeMap<K,V> of(Map<K,V> map)
K
- V
- map
-
public V getValueOr(K key, V defaultValue)
Mapped
key
- identifies the value to retrievedefaultValue
- value to return if no entry exists for key
@Nonnull public Holder<V> find(@Nonnull K key)
JImmutableMap
key
- non-null key to search for
@Nonnull public Holder<JImmutableMap.Entry<K,V>> findEntry(@Nonnull K key)
JImmutableMap
key
- non-null key to search for
@Nonnull public JImmutableTreeMap<K,V> assign(@Nonnull K key, V value)
JImmutableMap
key
- non-null keyvalue
- possibly null value
@Nonnull public JImmutableTreeMap<K,V> delete(@Nonnull K key)
JImmutableMap
key
- non-null key
public int size()
JImmutableMap
@Nonnull public JImmutableTreeMap<K,V> deleteAll()
@Nonnull public Cursor<JImmutableMap.Entry<K,V>> cursor()
public List<K> getKeysList()
public void verifyDepthsMatch()
public Comparator<K> getComparator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |