Class ParanoidHashSet<T>

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

    public class ParanoidHashSet<T>
    extends java.util.LinkedHashSet<T>
    a debugging aid. This implementation complains if you stick an object in here which appears to use System.identityHashCode(), or if it detects more than BAD_HC collisions in the Set (possibly indicated a bad hash function)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long serialVersionUID  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(T arg0)  
      • Methods inherited from class java.util.LinkedHashSet

        spliterator
      • Methods inherited from class java.util.HashSet

        clear, clone, contains, isEmpty, iterator, remove, size
      • Methods inherited from class java.util.AbstractSet

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

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

        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

        addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
    • Constructor Detail

      • ParanoidHashSet

        public ParanoidHashSet​(java.util.Collection<T> s)
                        throws java.lang.NullPointerException
        Parameters:
        s -
        Throws:
        java.lang.NullPointerException - if s is null
      • ParanoidHashSet

        public ParanoidHashSet()
      • ParanoidHashSet

        public ParanoidHashSet​(int size)
    • Method Detail

      • add

        public boolean add​(T arg0)
        Specified by:
        add in interface java.util.Collection<T>
        Specified by:
        add in interface java.util.Set<T>
        Overrides:
        add in class java.util.HashSet<T>
        Throws:
        UnimplementedError - if there's a bad hash code problem
        See Also:
        Collection.add(java.lang.Object)