Java Iterator from getIterable(final Iterator i)

Here you can find the source of getIterable(final Iterator i)

Description

Wraps iterator into iterable

License

Open Source License

Declaration

public static <T> Iterable<T> getIterable(final Iterator<T> i) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Iterator;

public class Main {
    /**//w  w w  .  j av  a 2s. c  o m
     * Wraps iterator into iterable
     */
    public static <T> Iterable<T> getIterable(final Iterator<T> i) {
        return new Iterable<T>() {
            @Override
            public Iterator<T> iterator() {
                return i;
            }
        };
    }
}

Related

  1. getDestinationType(ImageReadParam param, Iterator imageTypes)
  2. getEmptyIterator()
  3. getEnumeratedObjectCount(Iterator objects)
  4. getFirstChildrendIterator(List children)
  5. getIndexInIterator(Iterator iterator, int index)
  6. getIterator(final int[] p, final Object[] data)
  7. getIterator(final Object o, final Class classElement)
  8. getIterator(List list)
  9. getIterator(T[] array)