|
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 |
|---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
FixedSizeArrayHashMap(int maxCapacity)
Creates a FixedSizeArrayHashMap with the specified maxmium capacity. |
|
FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity)
|
|
FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity,
float loadFactor)
|
|
FixedSizeArrayHashMap(int maxCapacity,
Map<? extends K,? extends V> m)
Creates a new FixedSizeArrayHashMap with the provided maximum capacity and adds elements from the specified Map. |
|
FixedSizeArrayHashMap(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()
|
Object |
clone()
|
Set<Map.Entry<K,V>> |
entrySet()
|
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. |
Set<K> |
keySet()
Returns a Set view of the keys contained in this map. |
protected Iterator<Map.Entry<K,V>> |
newEntryIterator()
|
V |
put(K key,
V value)
|
V |
remove(Object key)
|
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,
Map<? extends K,? extends V> m)
public FixedSizeArrayHashMap(Map<? extends K,? extends V> m)
public FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity,
float loadFactor)
public FixedSizeArrayHashMap(int maxCapacity,
int initialCapacity)
| Method Detail |
|---|
public Object clone()
clone in class HashMap<K,V>public void clear()
clear in interface Map<K,V>clear in class HashMap<K,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K,V>entrySet in class 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 Map.Entry<K,V> getEntryAt(int i)
RandomAccessMap
getEntryAt in interface RandomAccessMap<K,V>
public V put(K key,
V value)
put in interface Map<K,V>put in class HashMap<K,V>public V remove(Object key)
remove in interface Map<K,V>remove in class HashMap<K,V>protected Iterator<Map.Entry<K,V>> newEntryIterator()
public 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 Map<K,V>keySet in class HashMap<K,V>public 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 Map<K,V>values in class HashMap<K,V>
|
LimeWire Collection Component API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||