/** * Gets the size of the map. * * @return the size */ @Override public int size() { if (delegateMap != null) { return delegateMap.size(); } return size; }
@Override public int size() { return parent.size(); }
@Override public int size() { return parent.size(); }
@Override public int size() { return parent.size(); }
/** * Gets the size of the map. * * @return the size */ @Override public int size() { purgeBeforeRead(); return super.size(); }
/** * Decorates the specified map to add the MultiKeyMap API and fast query. * The map must not be null and must be empty. * * @param <K> the key type * @param <V> the value type * @param map the map to decorate, not null * @return a new multi key map * @throws NullPointerException if map is null * @throws IllegalArgumentException if the map is not empty * @since 4.0 */ public static <K, V> MultiKeyMap<K, V> multiKeyMap(final AbstractHashedMap<MultiKey<? extends K>, V> map) { if (map == null) { throw new NullPointerException("Map must not be null"); } if (map.size() > 0) { throw new IllegalArgumentException("Map must be empty"); } return new MultiKeyMap<>(map); }
/** * Creates an entry set iterator. * Subclasses can override this to return iterators with different properties. * * @return the entrySet iterator */ protected Iterator<Map.Entry<K, V>> createEntrySetIterator() { if (size() == 0) { return EmptyIterator.<Map.Entry<K, V>>emptyIterator(); } return new EntrySetIterator<>(this); }
/** * Creates a key set iterator. * Subclasses can override this to return iterators with different properties. * * @return the keySet iterator */ protected Iterator<K> createKeySetIterator() { if (size() == 0) { return EmptyIterator.<K>emptyIterator(); } return new KeySetIterator<>(this); }
/** * Creates a values iterator. * Subclasses can override this to return iterators with different properties. * * @return the values iterator */ protected Iterator<V> createValuesIterator() { if (size() == 0) { return EmptyIterator.<V>emptyIterator(); } return new ValuesIterator<>(this); }
if (map.size() != size()) { return false;
private void prepareNext() throws IOException { while (cache.size() < capacity && source.hasTop()) { putCache(source.getTopKey(), source.getTopValue()); source.next();