Title: RE: [castor-dev] hasMore() or hasMoreElements()
I've just checked the code, and the different sets of methods seem to have different functionality!!
 
Specifically, hasMore() and next() allow any PersistenceExceptions thrown during the operation to be propagated back up to the user,
where, hasMoreElements() and nextElement() swallow any PersistenceExceptions thrown. (!!!)
 
This scares me somewhat - (there's not often a good case for swallowing exceptions, and I don't think this is one of them).
 
 
-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED]]
Sent: 23 September 2001 23:48
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] hasMore() or hasMoreElements()

hasMoreElements() and nextElement() are so it can implement java.util.Enumeration
I'm not sure why the hasMore() and next() functions are also there (perhaps to avoid changing existing code after the decision to implement Enumeration).

I'd say either is fine, but I'd stick to one or the other and the Enumeration style is probably better in that instance.

- Brett

-----Original Message-----
From: Tim Fox [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 22 September 2001 12:55 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] hasMore() or hasMoreElements()


The class org.exolab.castor.jdo.QueryResults has the following public
methods:

hasMore()
hasMoreElements()
next()
nextElement()
close()

When iterating through a result-set should I use either:
hasMore(), and
next()

or

hasMoreElements(), and
nextElement()

??

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to