Here you can find the source of toIterator(Collection
Parameter | Description |
---|---|
col | The collection to be turned in to an iterator |
public static <E> Iterator<E> toIterator(Collection<E> col)
//package com.java2s; /*/*from ww w.ja v a2 s. c om*/ * MiscUtils.java * * Copyright (c) 1998 - 2006 BusinessTechnology, Ltd. * All rights reserved * * This program is the proprietary and confidential information * of BusinessTechnology, Ltd. and may be used and disclosed only * as authorized in a license agreement authorizing and * controlling such use and disclosure * * Millennium ERP system. * */ import java.util.Collection; import java.util.Iterator; public class Main { /** * Get an iterator from a collection, returning null if collection is null * * @param col The collection to be turned in to an iterator * @return The resulting Iterator */ public static <E> Iterator<E> toIterator(Collection<E> col) { if (col == null) return null; else return col.iterator(); } }