Class Long2ObjectCache.KeySet

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Long>, java.util.Collection<java.lang.Long>, java.util.Set<java.lang.Long>
    Enclosing class:
    Long2ObjectCache<V>

    public final class Long2ObjectCache.KeySet
    extends java.util.AbstractSet<java.lang.Long>
    A key set implementation which supports cached iterator to avoid allocation.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeySet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      boolean contains​(long key)
      Check if the given key contained in the set without boxing.
      boolean contains​(java.lang.Object o)
      Long2ObjectCache.KeyIterator iterator()
      boolean remove​(java.lang.Object o)
      boolean removeIf​(java.util.function.Predicate<? super java.lang.Long> filter)
      int size()
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        add, addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        add, addAll, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
    • Constructor Detail

      • KeySet

        public KeySet()
    • Method Detail

      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.Long>
        Specified by:
        size in interface java.util.Set<java.lang.Long>
        Specified by:
        size in class java.util.AbstractCollection<java.lang.Long>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<java.lang.Long>
        Specified by:
        contains in interface java.util.Set<java.lang.Long>
        Overrides:
        contains in class java.util.AbstractCollection<java.lang.Long>
      • contains

        public boolean contains​(long key)
        Check if the given key contained in the set without boxing.
        Parameters:
        key - to be checked.
        Returns:
        true if key is contained in the cache.
      • iterator

        public Long2ObjectCache.KeyIterator iterator()
        Specified by:
        iterator in interface java.util.Collection<java.lang.Long>
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.Long>
        Specified by:
        iterator in interface java.util.Set<java.lang.Long>
        Specified by:
        iterator in class java.util.AbstractCollection<java.lang.Long>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<java.lang.Long>
        Specified by:
        remove in interface java.util.Set<java.lang.Long>
        Overrides:
        remove in class java.util.AbstractCollection<java.lang.Long>
      • removeIf

        public boolean removeIf​(java.util.function.Predicate<? super java.lang.Long> filter)
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<java.lang.Long>
        Specified by:
        clear in interface java.util.Set<java.lang.Long>
        Overrides:
        clear in class java.util.AbstractCollection<java.lang.Long>