tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Ostermiller Utilities > Array to Iterator

Array to Iterator 

Ostermiller Java Utilities contain various components such as CSV parsing, Base64 Encoding, MD5 digest, String and Exec Helper classes. This requires the library ostermillerutils-1.08.01.jar to be in classpath. The following example shows converting an Array to Iterator.

File Name  :  
com/bethecoder/tutorials/ostermillerutils/Array2IteratorTest.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.ostermillerutils;

import java.util.Iterator;

import com.Ostermiller.util.ArrayIterator;

public class Array2IteratorTest {

  /**
   @param args
   */
  public static void main(String[] args) {
    
    Iterator<String> it = new ArrayIterator<String>(
        new String[] { "ONE""TWO""THREE""FOUR" }
    );
    
    while (it.hasNext()) {
      System.out.println(it.next());
    }
  }

}
   

It gives the following output,
ONE
TWO
THREE
FOUR



 
  


  
bl  br