Interface IterableWithSize<E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addAllTo​(java.util.Collection<? super E> collection)  
      boolean isEmpty()  
      int size()  
      E[] toArray​(E[] a)
      Iterating over array is faster, when checking for concurrent modification is not needed.
      java.util.ArrayList<E> toArrayList()
      Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • size

        int size()
      • isEmpty

        boolean isEmpty()
      • addAllTo

        void addAllTo​(@NotNull
                      java.util.Collection<? super E> collection)
      • toArrayList

        @NotNull
        java.util.ArrayList<E> toArrayList()
        Returns new ArrayList containing the same elements, so modifying the returned list does not modify the original collection.
      • toArray

        @NotNull
        E[] toArray​(@NotNull
                    E[] a)
        Iterating over array is faster, when checking for concurrent modification is not needed.
        Parameters:
        a - - must have exactly the same size as the collection