/** * Sets the maximum time any value will be kept in the map, before it expires. * Removes any items that are older than the specified time. * * @param pExpiryTime the expiry time (time to live) for elements in this map */ public void setExpiryTime(long pExpiryTime) { long oldEexpiryTime = expiryTime; expiryTime = pExpiryTime; if (expiryTime < oldEexpiryTime) { // Expire now nextExpiryTime = 0; removeExpiredEntries(); } }
/** * Returns the number of key-value mappings in this map. If the * map contains more than {@code Integer.MAX_VALUE} elements, returns * {@code Integer.MAX_VALUE}. * * @return the number of key-value mappings in this map. */ public int size() { removeExpiredEntries(); return entries.size(); }
/** * Returns {@code true} if this map contains a mapping for the specified * pKey. * * @param pKey pKey whose presence in this map is to be tested. * @return {@code true} if this map contains a mapping for the specified * pKey. */ public boolean containsKey(Object pKey) { removeExpiredEntries(); return entries.containsKey(pKey); }
public Collection<V> values() { removeExpiredEntries(); return super.values(); }
public Set<Entry<K, V>> entrySet() { removeExpiredEntries(); return super.entrySet(); }
public Set<K> keySet() { removeExpiredEntries(); return super.keySet(); }
removeExpiredEntries(); modCount++;
/** * Returns {@code true} if this map contains a mapping for the specified * pKey. * * @param pKey pKey whose presence in this map is to be tested. * @return {@code true} if this map contains a mapping for the specified * pKey. */ public boolean containsKey(Object pKey) { removeExpiredEntries(); return entries.containsKey(pKey); }
/** * Returns the number of key-value mappings in this map. If the * map contains more than {@code Integer.MAX_VALUE} elements, returns * {@code Integer.MAX_VALUE}. * * @return the number of key-value mappings in this map. */ public int size() { removeExpiredEntries(); return mEntries.size(); }
/** * Returns the number of key-value mappings in this map. If the * map contains more than {@code Integer.MAX_VALUE} elements, returns * {@code Integer.MAX_VALUE}. * * @return the number of key-value mappings in this map. */ public int size() { removeExpiredEntries(); return entries.size(); }
/** * Returns the number of key-value mappings in this map. If the * map contains more than {@code Integer.MAX_VALUE} elements, returns * {@code Integer.MAX_VALUE}. * * @return the number of key-value mappings in this map. */ public int size() { removeExpiredEntries(); return entries.size(); }
/** * Returns {@code true} if this map contains a mapping for the specified * pKey. * * @param pKey pKey whose presence in this map is to be tested. * @return {@code true} if this map contains a mapping for the specified * pKey. */ public boolean containsKey(Object pKey) { removeExpiredEntries(); return entries.containsKey(pKey); }
/** * Returns {@code true} if this map contains a mapping for the specified * pKey. * * @param pKey pKey whose presence in this map is to be tested. * @return {@code true} if this map contains a mapping for the specified * pKey. */ public boolean containsKey(Object pKey) { removeExpiredEntries(); return mEntries.containsKey(pKey); }
public Collection<V> values() { removeExpiredEntries(); return super.values(); }
public Set<K> keySet() { removeExpiredEntries(); return super.keySet(); }
public Set<Entry<K, V>> entrySet() { removeExpiredEntries(); return super.entrySet(); }
public Collection<V> values() { removeExpiredEntries(); return super.values(); }
public Set<Entry<K, V>> entrySet() { removeExpiredEntries(); return super.entrySet(); }
public Set<Entry<K, V>> entrySet() { removeExpiredEntries(); return super.entrySet(); }
public Set<K> keySet() { removeExpiredEntries(); return super.keySet(); }