Class LongHashSet

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Long>, java.util.Collection<java.lang.Long>, java.util.Set<java.lang.Long>, Accountable

    final class LongHashSet
    extends java.util.AbstractSet<java.lang.Long>
    implements Accountable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long BASE_RAM_BYTES  
      (package private) int hashCode  
      (package private) boolean hasMissingValue  
      (package private) int mask  
      private static long MISSING  
      (package private) int size  
      (package private) long[] table  
    • Constructor Summary

      Constructors 
      Constructor Description
      LongHashSet​(long... values)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean add​(long l)  
      (package private) boolean contains​(long l)  
      boolean contains​(java.lang.Object o)  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      java.util.Iterator<java.lang.Long> iterator()  
      long ramBytesUsed()
      Return the memory usage of this object in bytes.
      int size()  
      • Methods inherited from class java.util.AbstractSet

        removeAll
      • Methods inherited from class java.util.AbstractCollection

        add, addAll, clear, containsAll, isEmpty, remove, 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, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        add, addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray
    • Field Detail

      • BASE_RAM_BYTES

        private static final long BASE_RAM_BYTES
      • table

        final long[] table
      • mask

        final int mask
      • hasMissingValue

        final boolean hasMissingValue
      • size

        final int size
      • hashCode

        final int hashCode
    • Constructor Detail

      • LongHashSet

        LongHashSet​(long... values)
    • Method Detail

      • add

        private boolean add​(long l)
      • contains

        boolean contains​(long l)
      • 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>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<java.lang.Long>
        Specified by:
        hashCode in interface java.util.Set<java.lang.Long>
        Overrides:
        hashCode in class java.util.AbstractSet<java.lang.Long>
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Collection<java.lang.Long>
        Specified by:
        equals in interface java.util.Set<java.lang.Long>
        Overrides:
        equals in class java.util.AbstractSet<java.lang.Long>
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
        Specified by:
        ramBytesUsed in interface Accountable
      • 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>
      • iterator

        public java.util.Iterator<java.lang.Long> 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>