edu.stanford.nlp.util
Class Iterators

java.lang.Object
  extended byedu.stanford.nlp.util.Iterators

public class Iterators
extends Object

Contains convenience methods, and utilities for java.util.Iterators

Author:
Huy Nguyen (htnguyen@cs.stanford.edu)

Constructor Summary
Iterators()
           
 
Method Summary
static Collection addAll(Iterator iter, Collection c)
          Adds all of the Objects returned by the given Iterator into the given Collection.
static ArrayList asArrayList(Iterator iter)
          Creates an ArrayList containing all of the Objects returned by the given Iterator.
static Collection asCollection(Iterator iter, CollectionFactory cf)
          Creates a new Collection from the given CollectionFactory, and adds all of the Objects returned by the given Iterator.
static HashSet asHashSet(Iterator iter)
          Creates a HashSet containing all of the Objects returned by the given Iterator.
static void main(String[] args)
          For internal debugging purposes only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterators

public Iterators()
Method Detail

asArrayList

public static ArrayList asArrayList(Iterator iter)
Creates an ArrayList containing all of the Objects returned by the given Iterator.


asHashSet

public static HashSet asHashSet(Iterator iter)
Creates a HashSet containing all of the Objects returned by the given Iterator.


asCollection

public static Collection asCollection(Iterator iter,
                                      CollectionFactory cf)
Creates a new Collection from the given CollectionFactory, and adds all of the Objects returned by the given Iterator.


addAll

public static Collection addAll(Iterator iter,
                                Collection c)
Adds all of the Objects returned by the given Iterator into the given Collection.

Returns:
the given Collection

main

public static void main(String[] args)
For internal debugging purposes only.



Stanford NLP Group