Interface Traversable<E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <U> void forEach​(@NotNull Function<E,​U> f)
      All collection methods can be built upon this forEach definition.
      boolean isEmpty()
      Returns true if this collection is empty.
      @NotNull java.lang.String makeString​(@NotNull java.lang.String separator)
      Returns this collection converted to a string by joining elements together with the specified separator.
      @NotNull java.lang.String makeString​(@NotNull java.lang.String separator, @NotNull java.lang.String prefix, @NotNull java.lang.String postfix, int limit, @NotNull java.lang.String truncated)
      Returns this collection converted to a string.
      int size()
      Returns the size of the collection.
      <R extends Traversable<E>>
      R
      to​(@NotNull Builder<E,​R> builder)
      Converts this collection to another collection using a builder.
      @NotNull java.lang.Object[] toArray()
      Converts this collection to an array of objects.
      @NotNull E[] toArray​(E[] array)
      Converts this collection to an array of objects of the correct type.
      @NotNull IndexedList<E> toIndexedList()
      Converts this collection to an indexed list.
      @NotNull Set<E> toSet()
      Converts this collection to a set.
      @NotNull SortedSet<E> toSortedSet​(java.util.Comparator<? super E> comparator)
      Converts this collection to a sorted set.
    • Method Detail

      • forEach

        <U> void forEach​(@NotNull
                         @NotNull Function<E,​U> f)
        All collection methods can be built upon this forEach definition.
      • size

        int size()
        Returns the size of the collection.

        Warning: infinite collections are possible, as are collections that require traversal to calculate the size.

      • isEmpty

        boolean isEmpty()
        Returns true if this collection is empty.
      • makeString

        @NotNull
        @NotNull java.lang.String makeString​(@NotNull
                                             @NotNull java.lang.String separator)
        Returns this collection converted to a string by joining elements together with the specified separator.
      • makeString

        @NotNull
        @NotNull java.lang.String makeString​(@NotNull
                                             @NotNull java.lang.String separator,
                                             @NotNull
                                             @NotNull java.lang.String prefix,
                                             @NotNull
                                             @NotNull java.lang.String postfix,
                                             int limit,
                                             @NotNull
                                             @NotNull java.lang.String truncated)
        Returns this collection converted to a string.
        Parameters:
        separator - Specifies the joining character
        prefix - Specifies a prefix to the string
        postfix - Species a postfix to the string
        limit - Specifies the maximum number of elements to join. If the limit is exceeded, additional elements are ignored.
        truncated - If the limit is reached, the truncated value will be appended to indicate the limit was reached.
      • to

        @NotNull
        <R extends Traversable<E>> R to​(@NotNull
                                        @NotNull Builder<E,​R> builder)
        Converts this collection to another collection using a builder.
      • toSet

        @NotNull
        @NotNull Set<E> toSet()
        Converts this collection to a set.
      • toSortedSet

        @NotNull
        @NotNull SortedSet<E> toSortedSet​(java.util.Comparator<? super E> comparator)
        Converts this collection to a sorted set.
      • toIndexedList

        @NotNull
        @NotNull IndexedList<E> toIndexedList()
        Converts this collection to an indexed list.
      • toArray

        @NotNull
        @NotNull java.lang.Object[] toArray()
        Converts this collection to an array of objects.
      • toArray

        @NotNull
        @NotNull E[] toArray​(E[] array)
        Converts this collection to an array of objects of the correct type.