All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.docshare.boot.ArrayEnum Maven / Gradle / Ivy

package org.docshare.boot;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Set;


public class ArrayEnum  implements Enumeration{

	private ArrayList arr = null;
	int it = 0;
	public ArrayEnum(Set set) {
		arr  = new ArrayList(set);
	}
	public ArrayEnum(){
		arr = new ArrayList();
	}
	
	public ArrayEnum(ArrayList arr)  {
		this.arr = arr;
	}
	
	@SuppressWarnings("unchecked")
	public void add( Enumeration e){
		
		while(e.hasMoreElements()){
			arr.add((E) e.nextElement());
		}
	}
	
	
	@Override
	public boolean hasMoreElements() {
		return it