net.walend.ejb
Class OneMemberEnumeration

java.lang.Object
  |
  +--net.walend.ejb.OneMemberEnumeration
All Implemented Interfaces:
java.util.Enumeration

public class OneMemberEnumeration
extends java.lang.Object
implements java.util.Enumeration

An Enumeration that contains a single object. This class exists because findBy methods have to return either an Enumeration or the exact entity bean interface. You'd think that'd work out OK, but it doesn't.

I had to use this hack to return abstract types from within the EJB 1.1 specification without hacking client code.

Since:
12-5-2000
Author:
David Walend

Field Summary
private  boolean hasNext
           
private  java.lang.Object object
           
 
Constructor Summary
OneMemberEnumeration(java.lang.Object ob)
           
 
Method Summary
 boolean hasMoreElements()
           
 java.lang.Object nextElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

private java.lang.Object object

hasNext

private boolean hasNext
Constructor Detail

OneMemberEnumeration

public OneMemberEnumeration(java.lang.Object ob)
Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
Specified by:
nextElement in interface java.util.Enumeration


Copyright (c) 2000, 2001, David Walend