|
LimeWire collection component api | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
org.limewire.collection.FixedSizeArrayHashMap<K,V>
public class FixedSizeArrayHashMap<K,V>
A fixed size HashMap that provides indexed access. The replacement policy is FIFO and the iteration order is from newest to oldest.
Adding an already existing element will postpone the ejection of that element.
It does not support the null element.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.util.AbstractMap |
|---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
FixedSizeArrayHashMap(int maxCapacity)
Creates a FixedSizeArrayHashMap with the specified maximum capacity. |
|
FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity)
|
|
FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity,
float loadFactor)
|
|
FixedSizeArrayHashMap(int maxCapacity,
java.util.Map<? extends K,? extends V> m)
Creates a new FixedSizeArrayHashMap with the provided maximum capacity and adds elements from the specified Map. |
|
FixedSizeArrayHashMap(java.util.Map<? extends K,? extends V> m)
Creates a new FixedSizeArrayHashMap with the maximum capacity of the size of the provided Map and adds all the elements of that Map. |
|
| Method Summary | |
|---|---|
void |
clear()
|
java.lang.Object |
clone()
|
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet()
|
java.util.Map.Entry<K,V> |
getEntryAt(int i)
Retrieves the entry at index i. |
K |
getKeyAt(int i)
Retrieves the key at index i. |
V |
getValueAt(int i)
Retrieves the value at index i. |
java.util.Set<K> |
keySet()
Returns a Set view of the keys contained in this map. |
protected java.util.Iterator<java.util.Map.Entry<K,V>> |
newEntryIterator()
|
V |
put(K key,
V value)
|
V |
remove(java.lang.Object key)
|
java.util.Collection<V> |
values()
Returns a collection view of the values contained in this map. |
| Methods inherited from class java.util.HashMap |
|---|
containsKey, containsValue, get, isEmpty, putAll, size |
| Methods inherited from class java.util.AbstractMap |
|---|
equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
containsKey, containsValue, equals, get, hashCode, isEmpty, putAll, size |
| Constructor Detail |
|---|
public FixedSizeArrayHashMap(int maxCapacity)
public FixedSizeArrayHashMap(int maxCapacity,
java.util.Map<? extends K,? extends V> m)
public FixedSizeArrayHashMap(java.util.Map<? extends K,? extends V> m)
public FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity,
float loadFactor)
public FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity)
| Method Detail |
|---|
public java.lang.Object clone()
clone in class java.util.HashMap<K,V>public void clear()
clear in interface java.util.Map<K,V>clear in class java.util.HashMap<K,V>public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
entrySet in interface java.util.Map<K,V>entrySet in class java.util.HashMap<K,V>public V getValueAt(int i)
RandomAccessMap
getValueAt in interface RandomAccessMap<K,V>public K getKeyAt(int i)
RandomAccessMap
getKeyAt in interface RandomAccessMap<K,V>public java.util.Map.Entry<K,V> getEntryAt(int i)
RandomAccessMap
getEntryAt in interface RandomAccessMap<K,V>
public V put(K key,
V value)
put in interface java.util.Map<K,V>put in class java.util.HashMap<K,V>public V remove(java.lang.Object key)
remove in interface java.util.Map<K,V>remove in class java.util.HashMap<K,V>protected java.util.Iterator<java.util.Map.Entry<K,V>> newEntryIterator()
public java.util.Set<K> keySet()
This implementation returns a Set that subclasses AbstractSet. The subclass's iterator method returns a "wrapper object" over this map's entrySet() iterator. The size method delegates to this map's size method and the contains method delegates to this map's containsKey method.
The Set is created the first time this method is called, and returned in response to all subsequent calls. No synchronization is performed, so there is a slight chance that multiple calls to this method will not all return the same Set.
keySet in interface java.util.Map<K,V>keySet in class java.util.HashMap<K,V>public java.util.Collection<V> values()
This implementation returns a collection that subclasses abstract collection. The subclass's iterator method returns a "wrapper object" over this map's entrySet() iterator. The size method delegates to this map's size method and the contains method delegates to this map's containsValue method.
The collection is created the first time this method is called, and returned in response to all subsequent calls. No synchronization is performed, so there is a slight chance that multiple calls to this method will not all return the same Collection.
values in interface java.util.Map<K,V>values in class java.util.HashMap<K,V>
|
LimeWire collection component api | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||