Class HashSet

    • Constructor Detail

      • HashSet

        public HashSet()
      • HashSet

        public HashSet​(int initialCapacity)
    • Method Detail

      • add

        public boolean add​(Object o)
        Description copied from interface: Collection
        Adds an element.
        Specified by:
        add in interface Collection
        Returns:
        true if the element has been added.
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: Collection
        Checks if the collection contains elements.
        Specified by:
        isEmpty in interface Collection
        Returns:
        true if this collection contains no elements
      • iterator

        public Iterator iterator()
        Description copied from interface: Collection
        Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned.
        Specified by:
        iterator in interface Collection
        Returns:
        an Iterator over the elements in this collection
      • remove

        public boolean remove​(Object o)
        Description copied from interface: Collection
        Removes one instance of the specified element.
        Specified by:
        remove in interface Collection
        Parameters:
        o - the element to be removed
        Returns:
        true if the element has been removed
      • size

        public int size()
        Description copied from interface: Collection
        Returns the number of elements in this collection.
        Specified by:
        size in interface Collection
        Returns:
        the number of elements in this collection.
      • toArray

        public Object[] toArray()
        Description copied from interface: Collection
        Returns an array containing all of the elements in this collection.
        Specified by:
        toArray in interface Collection
        Returns:
        an array containing all of the elements in this collection
      • clear

        public void clear()
      • contains

        public boolean contains​(Object o)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • addAll

        public boolean addAll​(Collection c)
      • containsAll

        public boolean containsAll​(Collection c)
      • removeAll

        public boolean removeAll​(Collection c)