Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
VCollections – Release 1
Interface org.violetlib.collections.ISet
Inherited members: ShowHide
Deprecated: ShowHide
org.violetlib.collections

Interface ISet<V>

  • Type Parameters:
    V - The type of the values.
    All Superinterfaces:
    ICollection<V>, IIterable<V>, Iterable<V>
    public interface ISet<V> extends ICollection<V>, IIterable<V>
    An immutable set of elements. Null elements are not permitted. The iteration order may be unspecified.
    • Fields 
      Modifier and Type Field and Description
      Ordinary member indicator ORDERED Reveal DetailHide Detail
      static Option ORDERED
       
      static final Option ORDERED
    • Static Methods 
      Modifier and Type Static Method and Description
      Ordinary member indicator builder Reveal DetailHide Detail
      static <V> SetBuilder<V> builder()
      Create a builder for a set.
      static <V> SetBuilder<V> builder()
      Create a builder for a set. The iteration order of the set is unspecified.
      Type Parameters:
      V - The type of set elements.
      Returns:
      the builder.
      Ordinary member indicator builder Reveal DetailHide Detail
      static <V> SetBuilder<V> builder(Option option)
      Create a builder for a set whose iteration order is defined by the order in which elements are added to the builder.
      static <V> SetBuilder<V> builder(Option option)
      Create a builder for a set whose iteration order is defined by the order in which elements are added to the builder.
      Type Parameters:
      V - The type of set elements.
      Parameters:
      option -
      Returns:
      the builder.
      Inherited member indicator cast Reveal DetailHide Detail
      static <V> ICollection<V> cast(ICollection<?> o)
      Cast a collection to a specific type.
      static <V> ICollection<V> cast(ICollection<?> o)
      Description copied from interface: ICollection
      Cast a collection to a specific type. This method is no more reliable than an explicit type cast, but it prevents the warning.
      Ordinary member indicator cast Reveal DetailHide Detail
      static <V> ISet<V> cast(ISet<?> o)
      Cast a set to a specific type.
      static <V> ISet<V> cast(ISet<?> o)
      Cast a set to a specific type. This method is no more reliable than an explicit type cast, but it prevents the warning.
      Inherited member indicator concatenate Reveal DetailHide Detail
      static <V> ICollection<V> concatenate(ICollection<? extends V>... sources)
       
      @SafeVarargs static <V> ICollection<V> concatenate(ICollection<? extends V>... sources)
      Inherited member indicator concatenate Reveal DetailHide Detail
      static <V> ICollection<V> concatenate(IList<? extends ICollection<V>> sources)
       
      static <V> ICollection<V> concatenate(IList<? extends ICollection<V>> sources)
      Inherited member indicator concatenateIterators Reveal DetailHide Detail
      static <V> IIterator<V> concatenateIterators(IList<? extends IIterator<V>> sources)
       
      static <V> IIterator<V> concatenateIterators(IList<? extends IIterator<V>> sources)
      Ordinary member indicator create Reveal DetailHide Detail
      static <V> ISet<V> create(Iterable<? extends V> elements)
      Create a set containing the specified elements.
      static <V> ISet<V> create(Iterable<? extends V> elements) throws IllegalArgumentException
      Create a set containing the specified elements.
      Parameters:
      elements - An iterator that provides the elements.
      Returns:
      the set.
      Throws:
      IllegalArgumentException - if the iterator returns a null value.
      Ordinary member indicator create Reveal DetailHide Detail
      static <V> ISet<V> create(V[] elements)
      Create a set containing the specified elements.
      static <V> ISet<V> create(V[] elements) throws IllegalArgumentException
      Create a set containing the specified elements.
      Parameters:
      elements - An array that provides the elements.
      Returns:
      the set.
      Throws:
      IllegalArgumentException - if the array contains a null value.
      Ordinary member indicator empty Reveal DetailHide Detail
      static <V> ISet<V> empty()
      Return an empty set.
      static <V> ISet<V> empty()
      Return an empty set.
      Inherited member indicator emptyIterator Reveal DetailHide Detail
      static <V> IIterator<V> emptyIterator()
       
      static <V> IIterator<V> emptyIterator()
      Inherited member indicator from Reveal DetailHide Detail
      static <T> IIterable<T> from(Iterable<T> it)
      Create an IIterable from an Iterable.
      static <T> IIterable<T> from(Iterable<T> it)
      Description copied from interface: IIterable
      Create an IIterable from an Iterable. The iterators produced by the returned IIterable will throw a runtime exception if an iterator produced by the Iterable returns a null value.
      Parameters:
      it - The source iterable.
      Ordinary member indicator intersection Reveal DetailHide Detail
      static <V> ISet<V> intersection(ISet<V> s, ISet<?> p)
       
      static <V> ISet<V> intersection(ISet<V> s, ISet<?> p)
      Ordinary member indicator of Reveal DetailHide Detail
      static <V> ISet<V> of(V... es)
       
      @SafeVarargs static <V> ISet<V> of(V... es)
      Ordinary member indicator of Reveal DetailHide Detail
      static <V> ISet<V> of(V e)
       
      static <V> ISet<V> of(V e)
    • Methods 
      Modifier and Type Method and Description
      Ordinary member indicator choose Reveal DetailHide Detail
      V choose()
      Return one element of this set.
      V choose() throws NoSuchElementException
      Return one element of this set.
      Throws:
      NoSuchElementException - if the set is empty.
      Ordinary member indicator chooseOptional Reveal DetailHide Detail
      V chooseOptional()
      Return one element of this set, or null if the set is empty.
      V chooseOptional()
      Return one element of this set, or null if the set is empty.
      Ordinary member indicator contains Reveal DetailHide Detail
      boolean contains(Object target)
      Return true if and only if the specified element is an element of the collection.
      boolean contains(Object target)
      Description copied from interface: ICollection
      Return true if and only if the specified element is an element of the collection.
      Specified by:
      contains in interface ICollection<V>
      Parameters:
      target - The element to find in the list.
      Returns:
      true if and only if target is an element of the collection.
      Ordinary member indicator element Reveal DetailHide Detail
      V element()
      Return the sole element of this set.
      V element() throws NoSuchElementException
      Return the sole element of this set.
      Throws:
      NoSuchElementException - if the set does not contain exactly one element.
      Ordinary member indicator extending Reveal DetailHide Detail
      abstract ISet<V> extending(V value)
      Return a set containing the members of this set and the specified value.
      ISet<V> extending(V value)
      Return a set containing the members of this set and the specified value.
      Parameters:
      value - The value to be included in the result.
      Returns:
      A set containing the values from this set and the specified value.
      Ordinary member indicator extendingAll Reveal DetailHide Detail
      abstract ISet<V> extendingAll(ICollection<? extends V> values)
      Return a set containing the members of this set and the specified values.
      ISet<V> extendingAll(ICollection<? extends V> values)
      Return a set containing the members of this set and the specified values.
      Parameters:
      values - The values to be included in the result.
      Returns:
      A set containing the values from this set and the specified values.
      Ordinary member indicator filter Reveal DetailHide Detail
      ISet<V> filter(Predicate<V> predicate)
       
      ISet<V> filter(Predicate<V> predicate)
      Inherited member indicator find Reveal DetailHide Detail
      <R> R find(FindVisitor<V,R> visitor)
      Visit the elements of the collection until the visitor returns a non-null result.
      <R> R find(FindVisitor<V,R> visitor)
      Description copied from interface: ICollection
      Visit the elements of the collection until the visitor returns a non-null result. The elements are visited in the order defined by the collection (if there is one); otherwise, the visitation order is unspecified.
      Parameters:
      visitor - The visitor to call on the elements.
      Returns:
      the first non-null result returned by the visitor, or null if none.
      Inherited member indicator find Reveal DetailHide Detail
      <R> R find(FindVisitor<V,R> visitor, R defaultValue)
      Visit each element of the collection until the visitor returns a non-null result.
      <R> R find(FindVisitor<V,R> visitor, R defaultValue)
      Description copied from interface: ICollection
      Visit each element of the collection until the visitor returns a non-null result. The elements are visited in the order defined by the collection (if there is one); otherwise, the visitation order is unspecified.
      Parameters:
      visitor - The visitor to call on the elements.
      defaultValue - The value to return if no visitor call returns a non-null result.
      Returns:
      the first non-null result returned by the visitor, or defaultValue if none.
      Inherited member indicator forEach Reveal DetailHide Detail
      void forEach(Consumer<? super T> arg0)
       
      void forEach(Consumer<? super T> arg0)
      Ordinary member indicator intersecting Reveal DetailHide Detail
      ISet<V> intersecting(ISet<?> other)
       
      ISet<V> intersecting(ISet<?> other)
      Ordinary member indicator isEmpty Reveal DetailHide Detail
      boolean isEmpty()
      Return true if and only if there are no elements in the collection.
      boolean isEmpty()
      Description copied from interface: ICollection
      Return true if and only if there are no elements in the collection.
      Specified by:
      isEmpty in interface ICollection<V>
      Inherited member indicator iterator Reveal DetailHide Detail
      abstract IIterator<T> iterator()
      Returns an iterator over non-null elements of type T.
      IIterator<T> iterator()
      Description copied from interface: IIterable
      Returns an iterator over non-null elements of type T.
      Specified by:
      iterator in interface Iterable<T>
      Returns:
      an Iterator.
      Ordinary member indicator map Reveal DetailHide Detail
      abstract <R> ISet<R> map(Function<V,R> mapper)
       
      <R> ISet<R> map(Function<V,R> mapper)
      Ordinary member indicator ordered Reveal DetailHide Detail
      ISet<V> ordered()
      Return a set containing the members of this collection whose iteration order is defined by the natural sort order.
      ISet<V> ordered()
      Return a set containing the members of this collection whose iteration order is defined by the natural sort order.
      Ordinary member indicator ordered Reveal DetailHide Detail
      ISet<V> ordered(Comparator<? super V> comp)
      Return a set containing the members of this collection whose iteration order is defined by the specified comparator.
      ISet<V> ordered(Comparator<? super V> comp)
      Return a set containing the members of this collection whose iteration order is defined by the specified comparator.
      Ordinary member indicator removing Reveal DetailHide Detail
      abstract ISet<V> removing(Object value)
      Return a set containing the members of this set excluding the specified value.
      ISet<V> removing(Object value)
      Return a set containing the members of this set excluding the specified value.
      Parameters:
      value - The value to be excluded from the result.
      Returns:
      A set containing the values from this set, but not the specified value.
      Ordinary member indicator removingAll Reveal DetailHide Detail
      ISet<V> removingAll(ISet<?> values)
       
      ISet<V> removingAll(ISet<?> values)
      Ordinary member indicator size Reveal DetailHide Detail
      abstract int size()
      Return the number of elements in the collection.
      int size()
      Description copied from interface: ICollection
      Return the number of elements in the collection.
      Specified by:
      size in interface ICollection<V>
      Inherited member indicator sort Reveal DetailHide Detail
      IList<V> sort()
      Return a list containing the members of this collection, sorted in the natural sort order.
      IList<V> sort()
      Description copied from interface: ICollection
      Return a list containing the members of this collection, sorted in the natural sort order.
      Returns:
      the list.
      Inherited member indicator sort Reveal DetailHide Detail
      IList<V> sort(Comparator<? super V> c)
      Return a list containing the same elements as this collection, but sorted using the specified comparator.
      IList<V> sort(Comparator<? super V> c)
      Description copied from interface: ICollection
      Return a list containing the same elements as this collection, but sorted using the specified comparator.
      Parameters:
      c - The comparator used to determine the order of the elements in the returned list.
      Returns:
      the sorted list.
      Inherited member indicator spliterator Reveal DetailHide Detail
      Spliterator<V> spliterator()
      Return a Spliterator that yields the elements of the collection.
      Spliterator<V> spliterator()
      Description copied from interface: ICollection
      Return a Spliterator that yields the elements of the collection.
      Specified by:
      spliterator in interface Iterable<V>
      Inherited member indicator stream Reveal DetailHide Detail
      Stream<V> stream()
      Return a stream of the elements of the collection.
      Stream<V> stream()
      Description copied from interface: ICollection
      Return a stream of the elements of the collection.
      Inherited member indicator toJavaArray Reveal DetailHide Detail
      <E> E[] toJavaArray(E[] template)
      Return a new Java array containing the elements of this collection.
      <E> E[] toJavaArray(E[] template)
      Description copied from interface: ICollection
      Return a new Java array containing the elements of this collection.
      Inherited member indicator toJavaList Reveal DetailHide Detail
      List<V> toJavaList()
      Return a new Java list containing the elements of this collection, in the same order (if the collection defines an order).
      List<V> toJavaList()
      Description copied from interface: ICollection
      Return a new Java list containing the elements of this collection, in the same order (if the collection defines an order).
      Inherited member indicator toJavaSet Reveal DetailHide Detail
      Set<V> toJavaSet()
      Return a new Java set containing the elements of this collection.
      Set<V> toJavaSet()
      Description copied from interface: ICollection
      Return a new Java set containing the elements of this collection.
      Inherited member indicator toJavaUnmodifiableList Reveal DetailHide Detail
      List<V> toJavaUnmodifiableList()
      Return a new unmodifiable Java list containing the elements of this collection, in the same order (if the collection defines an order).
      List<V> toJavaUnmodifiableList()
      Description copied from interface: ICollection
      Return a new unmodifiable Java list containing the elements of this collection, in the same order (if the collection defines an order).
      Inherited member indicator toJavaUnmodifiableSet Reveal DetailHide Detail
      Set<V> toJavaUnmodifiableSet()
      Return a new Java set containing the elements of this collection.
      Set<V> toJavaUnmodifiableSet()
      Description copied from interface: ICollection
      Return a new Java set containing the elements of this collection.
      Inherited member indicator visit Reveal DetailHide Detail
      void visit(Visitor<V> visitor)
      Visit each element of the collection.
      void visit(Visitor<V> visitor)
      Description copied from interface: ICollection
      Visit each element of the collection. The elements are visited in the order defined by the collection (if there is one); otherwise, the visitation order is unspecified.
      Parameters:
      visitor - The visitor to call on the elements.