package Juno2.DataLoad;

import java.util.HashMap;
import java.util.Iterator;

import org.xml.sax.InputSource;

public class CustomerInputSource extends InputSource {

	private HashMap custList;
	Iterator keys;

	public CustomerInputSource(HashMap hm) {
		System.out.println("CustomerInputSource inside");
		custList = hm;

		System.out.println("CustomerInputSource list count = " + hm.size());
		//// Object[] = hm.values().toArray();
		Iterator keys = null;
	}

	public CustomerCVO getCustomer() {

		//// this could return the whole collection of customers
		//// then the parse driver could manage the iteration
		if(keys == null)
			keys = custList.keySet().iterator();

		if(keys.hasNext()){
			String customerId = (String)keys.next();
			return ((CustomerCVO)custList.get(customerId));
		}
		
		return null;
	}

}


