Class JdkBackedImmutableSet<E>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    final class JdkBackedImmutableSet<E>
    extends IndexedImmutableSet<E>
    ImmutableSet implementation backed by a JDK HashSet, used to defend against apparent hash flooding. This implementation is never used on the GWT client side, but it must be present there for serialization to work.
    • Field Detail

      • delegate

        private final java.util.Set<?> delegate
    • Constructor Detail

      • JdkBackedImmutableSet

        JdkBackedImmutableSet​(java.util.Set<?> delegate,
                              ImmutableList<E> delegateList)
    • Method Detail

      • contains

        public boolean contains​(@CheckForNull
                                java.lang.Object object)
        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>
      • 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>
      • 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>