public Collection<V> values() { removeExpiredEntries(); return super.values(); }
protected Entry<K, V> removeEntry(Entry<K, V> pEntry) { Entry<K, V> entry = super.removeEntry(pEntry); processRemoved(pEntry); return entry; }
@Override public void removeLRU() { while (maxSize <= currentSize) { // NOTE: maxSize here is mem size super.removeLRU(); } } }
public Set<Entry<K, V>> entrySet() { removeExpiredEntries(); return super.entrySet(); }
public Set<K> keySet() { removeExpiredEntries(); return super.keySet(); }
/** * Creates an LRUMap with initial mappings from the given map, * and the given max size. * * @param pContents the map whose mappings are to be placed in this map. * May be {@code null}. * @param pMaxSize size limit */ public LRUMap(Map<? extends K, ? extends V> pContents, int pMaxSize) { super(pContents, true); setMaxSize(pMaxSize); }
/** * This implementation simply returns {@code hasNext()}. * @see #hasNext() */ public final boolean hasMoreElements() { return hasNext(); }
public boolean addAll(Collection<? extends E> pCollection) { boolean changed = false; for (E value : pCollection) { if (add(value) && !changed) { changed = true; } } return changed; }
/** * Creates a StringTokenIterator * * @param pString the string to be parsed. * @param pDelimiters the delimiters. * @param pDirection iteration direction. */ public StringTokenIterator(String pString, String pDelimiters, int pDirection) { this(pString, toCharArray(pDelimiters), pDirection, false, false); }
/** * Returns {@code true} if the iteration has more elements. (In other * words, returns {@code true} if {@code next} would return an element * rather than throwing an exception.) * * @return {@code true} if the iterator has more elements. */ public boolean hasNext() { return (next != null || fetchNext() != null); }
/** * Sets the minutes part of the time. * * @param pMinutes an integer */ public void setMinutes(int pMinutes) { time = pMinutes * SECONDS_IN_MINUTE + getSeconds(); }
/** * Creates a new time with the given time (in seconds). */ public Time(int pTime) { setTime(pTime); }
/** * Returns the next element in the iteration as a {@code String}. * This implementation simply returns {@code (String) next()}. * * @return the next element in the iteration. * @exception java.util.NoSuchElementException iteration has no more elements. * @see #next() */ public final String nextToken() { return next(); }
private Object readResolve() throws IntrospectionException { // Initialize the property descriptors descriptors = initDescriptors(bean); return this; }
public Object[] getOtherElements() { Object[] k = getOtherKeys(); Object[] v = getOtherValues(); return makeEntryArray(k, v); }
/** * Implements the superclass method to return the map to be tested. * * @return the map to be tested */ public Object makeObject() { return makeEmptyMap(); }
/** * Returns an array of elements that are <I>not</I> contained in a * full collection. Every element in the returned array must * not exist in a collection returned by {@link #makeFullCollection()}. * The default implementation returns a heterogenous array of elements * without null. Note that some of the tests add these elements * to an empty or full collection, so if your collection restricts * certain kinds of elements, you should override this method. */ public Object[] getOtherElements() { return getOtherNonNullElements(); }