Java List Create createList( Iterator iterator )

Here you can find the source of createList( Iterator iterator )

Description

create List

License

Open Source License

Parameter

Parameter Description
iterator the Iterator of objects to put in List

Return

a List with contents from the Iterator objects

Declaration

public static List createList( Iterator iterator )
   

Method Source Code

//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;
    }
}

Related

  1. createIntegerSetFromIntegerList(List integerList)
  2. createInterfaceContent(String typeName, @SuppressWarnings("rawtypes") List superInterfaces, String indentation, String lineSeparator)
  3. createIntListToN(int n)
  4. createKeyValPair(List lst)
  5. createLimitSql(StringBuilder sql, Integer startNum, Integer rowNum, List params)
  6. createList()
  7. createList(Class elementClass)
  8. createList(Class itemClazz, T... items)
  9. createList(Collection collection)

  10. HOME | Copyright © www.java2s.com 2016