|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jjoost.collections.maps.base.AbstractHashMap<K,V,N>
public abstract class AbstractHashMap<K,V,N extends HashNode<N> & java.util.Map.Entry<K,V>>
| Method Summary | |
|---|---|
int |
clear()
Clears the map, returning the number of elements removed from it. |
java.util.Iterator<java.util.Map.Entry<K,V>> |
clearAndReturn()
Clears the map, returning the entries removed from it. |
boolean |
contains(K key)
Returns true iff a key occurs in the map which is equal to the parameter, as determined by the map's definition of equality. |
boolean |
contains(K key,
V val)
Returns true iff a (key,value) pair occurs in the map that is equal to those provided, as determined by the map's definition(s) of equality. |
int |
count(K key)
Returns the number of occurrences of keys present in the map that are equal to the one provided, as determined by the map's definition of equality. |
int |
count(K key,
V val)
Returns the number of occurrences of (key, value) pairs present in the map that are equal to the one provided, as determined by the map's definition(s) of equality. |
java.lang.Iterable<java.util.Map.Entry<K,V>> |
entries(K key)
Returns an Iterable over all key->value maplets in the map
whose key is equal to the one provided, as determined by the map's
definition of equality. |
V |
first(K key)
Returns the value associated with the first key that is equal to the one provided, as determined by the map's definition of equality. |
AnyMap<V,K> |
inverse()
Returns a map representing the inverse function of this map. |
boolean |
isEmpty()
Returns true iff the map is empty |
java.util.List<V> |
list(K key)
Returns a List of all values in the map which are mapped to by
the provided key, as determined by the map's definition of equality. |
int |
remove(K key)
Removes all occurrences of the provided key from domain of the map, returning an integer representing the total number of items removed |
int |
remove(K key,
V val)
Removes all occurrences of the provided key->value pair from the map, returning an integer representing the total number of items removed |
java.lang.Iterable<java.util.Map.Entry<K,V>> |
removeAndReturn(K key)
Removes all occurrences of the provided key from domain of the map, returning the entries removed |
java.lang.Iterable<java.util.Map.Entry<K,V>> |
removeAndReturn(K key,
V val)
Removes all occurrences of the provided key->value pair from the map, returning the entries removed |
V |
removeAndReturnFirst(K key)
Removes all occurrences of the provided key from domain of the map, returning the first such value removed, or null if none |
void |
shrink()
Attempts to make the map use less memory, if possible. |
int |
totalCount()
Return an integer representing the total number of maplets (i.e. |
MultiSet<V> |
values()
Returns a set representing the range of the map. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jjoost.collections.AnyMap |
|---|
add, copy, entries, keys, put, putIfAbsent, values |
| Methods inherited from interface org.jjoost.collections.AnyReadMap |
|---|
permitsDuplicateKeys, uniqueKeyCount |
| Method Detail |
|---|
public int remove(K key,
V val)
AnyMap
remove in interface AnyMap<K,V>key - the keyval - the val
public V removeAndReturnFirst(K key)
AnyMap
removeAndReturnFirst in interface AnyMap<K,V>key - the key to remove
public java.lang.Iterable<java.util.Map.Entry<K,V>> removeAndReturn(K key,
V val)
AnyMap
removeAndReturn in interface AnyMap<K,V>key - key to removeval - value to remove
public java.lang.Iterable<java.util.Map.Entry<K,V>> removeAndReturn(K key)
AnyMap
removeAndReturn in interface AnyMap<K,V>key - key to remove
public int remove(K key)
AnyMap
remove in interface AnyMap<K,V>key - remove
public boolean contains(K key,
V val)
AnyReadMap
contains in interface AnyReadMap<K,V>key - the keyval - the val
public boolean contains(K key)
AnyReadMap
contains in interface AnyReadMap<K,V>key - find
public int count(K key,
V val)
AnyReadMap
count in interface AnyReadMap<K,V>key - the keyval - the val
public int count(K key)
AnyReadMap
count in interface AnyReadMap<K,V>key - the key
public java.lang.Iterable<java.util.Map.Entry<K,V>> entries(K key)
AnyReadMapIterable over all key->value maplets in the map
whose key is equal to the one provided, as determined by the map's
definition of equality.
entries in interface AnyReadMap<K,V>key - find
public void shrink()
AnyMap
shrink in interface AnyMap<K,V>public V first(K key)
AnyReadMapnull if no matching key
is found.
first in interface AnyReadMap<K,V>key - the key
public java.util.List<V> list(K key)
AnyReadMapList of all values in the map which are mapped to by
the provided key, as determined by the map's definition of equality. This list
should be constructed "eagerly" and should be a consistent snapshot of
the values valid at some point between the method being called and it returning.
list in interface AnyReadMap<K,V>key - the key
public int totalCount()
AnyReadMap
totalCount in interface AnyReadMap<K,V>public boolean isEmpty()
AnyReadMap
isEmpty in interface AnyReadMap<K,V>public MultiSet<V> values()
AnyMap
values in interface AnyMap<K,V>values in interface AnyReadMap<K,V>public int clear()
AnyMap
clear in interface AnyMap<K,V>public java.util.Iterator<java.util.Map.Entry<K,V>> clearAndReturn()
AnyMapIterator will accurately
represent the elements that are removed from the map; however the Iterator must be exhausted for
the clear operation to be guaranteed to have completed.
clearAndReturn in interface AnyMap<K,V>public AnyMap<V,K> inverse()
AnyMap
inverse in interface AnyMap<K,V>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||