Source Code : Converts a Array to an Enumeration and allows it to be serialized
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Converts a Array to an Enumeration and allows it to be serialized

/*
* Copyright Javelin Software, All rights reserved.
*/
import java.util.*;
import java.io.*;
/**
* An ArrayEnumeration converts a Array to an Enumeration and allows it
* to be serialized.
* <p>
* @author Robin Sharp
*/
public class ArrayEnumeration implements Enumeration, Serializable
{
/**
* Construct a fully qualified ArrayEnumeration.
* @param array the array to be Enumerated.
*/
public ArrayEnumeration(Object[] array)
{
this.array = array;
}
// ENUMERATION /////////////////////////////////////////////////////////
/**
* @return true if there are more elements in the enumeration.
*/
public boolean hasMoreElements()
{
return array != null && index < array.length;
}
/**
* @return the next element in the enumeration
*/
public Object nextElement()
{
return array[index++];
}
// PRIVATE /////////////////////////////////////////////////////////////
private Object[] array;
private int index;
}
Thank with us