FileDocCategorySizeDatePackage
ObjrefEnumeration.javaAPI DocGlassfish v2 API2984Fri May 04 22:33:12 BST 2007com.sun.ejb.portable

ObjrefEnumeration

public final class ObjrefEnumeration extends Object implements Serializable, Enumeration
This class is necessary because neither Vector nor Hashtable return a Serializable Enumeration, which can be sent from the EJB server back to the client. This class must be available at the client too, and it could be instantiated in another vendor's container.

Fields Summary
private int
count
private ArrayList
objrefs
Constructors Summary
Methods Summary
public voidadd(java.lang.Object obj)


    // This is called only by the EJB container in the RI.
       
    
	if ( objrefs == null )
	    objrefs = new ArrayList();
	objrefs.add(obj);
    
public booleanhasMoreElements()

	if ( objrefs == null )
	    return false;
	return count < objrefs.size();
    
public java.lang.ObjectnextElement()

	if ( objrefs != null ) {
	    synchronized (this) {
		if (count < objrefs.size()) {
		    return objrefs.get(count++);
		}
	    }
	}
	throw new NoSuchElementException("ObjrefEnumeration");