/** * Gets the size of the map. * * @return the size */ public int size() { purgeBeforeRead(); return super.size(); }
/** * 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.INSTANCE; } return new KeySetIterator<K, V>(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.INSTANCE; } return new ValuesIterator<K, V>(this); }
/** * Creates an entry set iterator. * Subclasses can override this to return iterators with different properties. * * @return the entrySet iterator */ protected Iterator<Entry<K, V>> createEntrySetIterator() { if (size() == 0) { return EmptyIterator.INSTANCE; } return new EntrySetIterator<K, V>(this); }
/** * Checks whether the map is currently empty. * * @return true if the map is currently size zero */ public boolean isEmpty() { purgeBeforeRead(); return super.isEmpty(); }
/** * Checks whether the map contains the specified value. * * @param value the value to search for * @return true if the map contains the value */ public boolean containsValue(Object value) { purgeBeforeRead(); if (value == null) { return false; } return super.containsValue(value); }
/** * Gets the size of the map. * * @return the size */ public int size() { purgeBeforeRead(); return super.size(); }
/** * 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.INSTANCE; } return new KeySetIterator<K, V>(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.INSTANCE; } return new ValuesIterator<K, V>(this); }
/** * 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.INSTANCE; } return new EntrySetIterator<K, V>(this); }
/** * Checks whether the map is currently empty. * * @return true if the map is currently size zero */ public boolean isEmpty() { purgeBeforeRead(); return super.isEmpty(); }
/** * Gets the size of the map. * * @return the size */ public int size() { purgeBeforeRead(); return super.size(); }
/** * 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.INSTANCE; } return new KeySetIterator<K, V>(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.INSTANCE; } return new ValuesIterator<K, V>(this); }
/** * 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.INSTANCE; } return new EntrySetIterator<K, V>(this); }