Interface ConcurrentMap

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Iterator randomEntryIterator()
      Iterate over map entries, beginning at an arbitrary (not strictly random) entry.
      java.util.Map.Entry removeRandom()
      Remove an arbitrary(not strictly random) entry from the map.
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • Method Detail

      • removeRandom

        java.util.Map.Entry removeRandom()
        Remove an arbitrary(not strictly random) entry from the map. This allows implementation of concurrent caches with size ceilings.
        Returns:
        the removed entry, or null if map is empty
      • randomEntryIterator

        java.util.Iterator randomEntryIterator()
        Iterate over map entries, beginning at an arbitrary (not strictly random) entry.