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

Interface ICollection<V>

  • Type Parameters:
    V - The type of the elements.
    All Superinterfaces:
    IIterable<V>, Iterable<V>
    All Known Subinterfaces:
    IList<V>, ISet<V>
    public interface ICollection<V> extends IIterable<V>
    Common methods for immutable collections.
    • Static Methods 
      Modifier and Type Static Method and Description
      Ordinary 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)
      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 concatenate Reveal DetailHide Detail
      static <V> ICollection<V> concatenate(ICollection<? extends V>... sources)
       
      @SafeVarargs static <V> ICollection<V> concatenate(ICollection<? extends V>... sources)
      Ordinary 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)
      Ordinary 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 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.
    • Methods 
      Modifier and Type Method and Description
      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)
      Return true if and only if the specified element is an element of the collection.
      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 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)
      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.
      Ordinary 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)
      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 isEmpty Reveal DetailHide Detail
      boolean isEmpty()
      Return true if and only if there are no elements in the collection.
      boolean isEmpty()
      Return true if and only if there are no elements in the collection.
      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 size Reveal DetailHide Detail
      int size()
      Return the number of elements in the collection.
      int size()
      Return the number of elements in the collection.
      Ordinary 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()
      Return a list containing the members of this collection, sorted in the natural sort order.
      Returns:
      the list.
      Ordinary 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)
      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.
      Ordinary member indicator spliterator Reveal DetailHide Detail
      Spliterator<V> spliterator()
      Return a Spliterator that yields the elements of the collection.
      Spliterator<V> spliterator()
      Return a Spliterator that yields the elements of the collection.
      Specified by:
      spliterator in interface Iterable<V>
      Ordinary member indicator stream Reveal DetailHide Detail
      Stream<V> stream()
      Return a stream of the elements of the collection.
      Stream<V> stream()
      Return a stream of the elements of the collection.
      Ordinary 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)
      Return a new Java array containing the elements of this collection.
      Ordinary 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()
      Return a new Java list containing the elements of this collection, in the same order (if the collection defines an order).
      Ordinary member indicator toJavaSet Reveal DetailHide Detail
      Set<V> toJavaSet()
      Return a new Java set containing the elements of this collection.
      Set<V> toJavaSet()
      Return a new Java set containing the elements of this collection.
      Ordinary 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()
      Return a new unmodifiable Java list containing the elements of this collection, in the same order (if the collection defines an order).
      Ordinary member indicator toJavaUnmodifiableSet Reveal DetailHide Detail
      Set<V> toJavaUnmodifiableSet()
      Return a new Java set containing the elements of this collection.
      Set<V> toJavaUnmodifiableSet()
      Return a new Java set containing the elements of this collection.
      Ordinary member indicator visit Reveal DetailHide Detail
      void visit(Visitor<V> visitor)
      Visit each element of the collection.
      void visit(Visitor<V> visitor)
      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.