Module org.hsqldb

Class HashSet<E>

java.lang.Object
org.hsqldb.map.BaseHashMap
org.hsqldb.lib.HashSet<E>
All Implemented Interfaces:
Collection<E>, Set<E>
Direct Known Subclasses:
OrderedHashSet

public class HashSet<E> extends org.hsqldb.map.BaseHashMap implements Set<E>
This class does not store null keys.
Since:
1.7.2
Author:
Fred Toussi (fredt@users dot sourceforge.net)
  • Constructor Details

  • Method Details

    • contains

      public boolean contains(Object key)
      Specified by:
      contains in interface Collection<E>
    • containsAll

      public boolean containsAll(Collection<?> col)
    • getOrAdd

      public E getOrAdd(E key)
    • get

      public E get(E key)
    • add

      public boolean add(E key)
      returns true if element is added
      Specified by:
      add in interface Collection<E>
      Parameters:
      key - the element
      Returns:
      true if added
    • addAll

      public boolean addAll(Collection<? extends E> c)
      returns true if any element is added
      Specified by:
      addAll in interface Collection<E>
      Parameters:
      c - the Collection to add
      Returns:
      true if any element is added
    • addAll

      public boolean addAll(E[] keys)
      returns true if any element is added
      Parameters:
      keys - the array of elements to add
      Returns:
      true if any element is added
    • addAll

      public boolean addAll(E[] keys, int start, int limit)
      returns true if any added
      Parameters:
      keys - array of keys to add
      start - first index to add
      limit - limit of index to add
      Returns:
      true if any element was added
    • remove

      public boolean remove(Object key)
      returns true if removed
      Specified by:
      remove in interface Collection<E>
      Parameters:
      key - Object to remove
      Returns:
      true if removed
    • removeAll

      public boolean removeAll(Collection<?> c)
      returns true if all were removed
      Parameters:
      c - Collection of elements to remove
      Returns:
      true if all removed
    • retainAll

      public boolean retainAll(Collection<?> c)
    • removeAll

      public boolean removeAll(E[] keys)
      returns true if all were removed
      Parameters:
      keys - E[]
      Returns:
      boolean
    • getCommonElementCount

      public int getCommonElementCount(Set<E> other)
    • toArray

      public <T> T[] toArray(T[] a)
    • toArray

      public Object[] toArray()
    • iterator

      public Iterator<E> iterator()
      Specified by:
      iterator in interface Collection<E>
    • toString

      public String toString()
      Returns a String like "[Drei, zwei, Eins]", exactly like java.util.HashSet.
      Overrides:
      toString in class Object
      Returns:
      String representation