Interface Set<E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean add​(E element)
      Adds an element to the group.
      void clear()
      Removes all elements from the collection.
      int getCount()  
      ListenerList<SetListener<E>> getSetListeners()  
      boolean remove​(E element)
      Removes an element from the group.
      void setComparator​(java.util.Comparator<E> comparator)
      Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order.
      • Methods inherited from interface org.apache.pivot.collections.Group

        contains
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • add

        boolean add​(E element)
        Description copied from interface: Group
        Adds an element to the group.
        Specified by:
        add in interface Group<E>
        Parameters:
        element - The element to add to the group.
        Returns:
        true if the element was added to the group; false, otherwise.
        See Also:
        SetListener.elementAdded(Set, Object)
      • remove

        boolean remove​(E element)
        Description copied from interface: Group
        Removes an element from the group.
        Specified by:
        remove in interface Group<E>
        Parameters:
        element - The element to remove from the set.
        Returns:
        true if the element was removed from the group; false, otherwise.
        See Also:
        SetListener.elementRemoved(Set, Object)
      • getCount

        int getCount()
        Returns:
        The number of elements in the set.
      • setComparator

        void setComparator​(java.util.Comparator<E> comparator)
        Description copied from interface: Collection
        Sets the collection's sort order, re-ordering the collection's contents and ensuring that new entries preserve the sort order.

        Calling this method more than once with the same comparator will re-sort the collection.

        Specified by:
        setComparator in interface Collection<E>
        Parameters:
        comparator - The comparator used to order elements in the collection, or null if the collection is unsorted.
        See Also:
        SetListener.setCleared(Set)