Here you can find the source of createList( Iterator iterator )
Parameter | Description |
---|---|
iterator | the Iterator of objects to put in List |
public static List createList( Iterator iterator )
//package com.java2s; import java.util.*; public class Main { /** //from w w w .java2 s . c om * @return a List with contents from the Iterator objects * @param iterator the Iterator of objects to put in List */ public static List createList(Iterator iterator) { List list = new ArrayList(); while (iterator.hasNext()) list.add(iterator.next()); return list; } }