Class RegularImmutableSet<E>

    • Field Detail

      • elements

        private final transient java.lang.Object[] elements
      • table

        final transient java.lang.Object[] table
      • mask

        private final transient int mask
      • hashCode

        private final transient int hashCode
    • Constructor Detail

      • RegularImmutableSet

        RegularImmutableSet​(java.lang.Object[] elements,
                            int hashCode,
                            java.lang.Object[] table,
                            int mask)
    • Method Detail

      • contains

        public boolean contains​(@Nullable
                                java.lang.Object target)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.Set<E>
        Specified by:
        contains in class ImmutableCollection<E>
      • size

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

        int copyIntoArray​(java.lang.Object[] dst,
                          int offset)
        Description copied from class: ImmutableCollection
        Copies the contents of this immutable collection into the specified array at the specified offset. Returns offset + size().
        Overrides:
        copyIntoArray in class ImmutableCollection<E>
      • isPartialView

        boolean isPartialView()
        Description copied from class: ImmutableCollection
        Returns true if this immutable collection's implementation contains references to user-created objects that aren't accessible via this collection's methods. This is generally used to determine whether copyOf implementations should make an explicit copy to avoid memory leaks.
        Specified by:
        isPartialView in class ImmutableCollection<E>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.Set<E>
        Overrides:
        hashCode in class ImmutableSet<E>