Java Iterator convertToList(Iterator iter)

Here you can find the source of convertToList(Iterator iter)

Description

convert To List

License

Open Source License

Declaration

public static List<Double> convertToList(Iterator<Double> iter) 

Method Source Code


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

import java.util.ArrayList;

import java.util.Iterator;
import java.util.List;

public class Main {
    public static List<Double> convertToList(Iterator<Double> iter) {
        List<Double> list = new ArrayList<Double>();
        while (iter.hasNext())
            list.add(iter.next());/*from w  w w  .  j  av a 2  s. com*/
        return list;
    }
}

Related

  1. contains(final Iterator iter, final E item)
  2. contains(Iterator it, T o)
  3. contains(Iterator iterator, Object element)
  4. contains(Iterator iterator, String value)
  5. convertToArray(Iterator iter)
  6. copy(Iterator iterator)
  7. copyIterator(Iterable iterable)
  8. copyIterator(Iterator iter)
  9. copyOf(Iterator elements)