Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-670

Add org.apache.commons.collections4.IteratorUtils.first(Iterator<E>)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.2
    • Iterator
    • None

    Description

      Add org.apache.commons.collections4.IteratorUtils.first(Iterator<E>):

          /**
           * Returns the <code>first</code> value in {@link Iterator}, throwing
           * <code>IndexOutOfBoundsException</code> if there is no such element.
           * <p>
           * The Iterator is advanced to <code>index</code> (or to the end, if
           * <code>index</code> exceeds the number of entries) as a side effect of this method.
           *
           * @param <E> the type of object in the {@link Iterator}
           * @param iterator  the iterator to get a value from
           * @return the first object
           * @throws IndexOutOfBoundsException if the request is invalid
           * @since 4.2
           */
           public static <E> E first(Iterator<E> iterator)
      

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: