Enumerations are deprecated, they were replaced by Iterator which duplicates Enumeration's functionality but has shorter method names (!) and also adds a remove() method. Some of the legacy Collections, Vector for instance, can still give you an Enumeration, but Iterators are flavour of the day. Why don't you want to use Iterator? If you've got client code that depends on Enumerations, you can write an adapter between the two.
> I believe you can. The Enumerator came first, later
> the Iterator, which was considered (at least by some)
> an improvement. You can read more about both in the
> API docs.
Considered an improvement at least by some? Since Enumerations don't do anything Iterators don't, it's hard to see why anyone would prefer the former. Or was that just you safeguarding against the inevitable "I prefer Enumerations" that's marching toward this thread at some point :-)
> Considered an improvement at least by some?
> Since Enumerations don't do anything Iterators don't,
> it's hard to see why anyone would prefer the former.
> Or was that just you safeguarding against the
> inevitable "I prefer Enumerations" that's marching
> toward this thread at some point :-)
I guess I was :-)
Where I go, there are regular arguments about the proper length of names, so I wouldn't be too sure.
Admitted, though, never having used an Enumeration myself, I wasn't sure about the exact differences. Glad you contributed it!
> > Considered an improvement at least by some?
> > Since Enumerations don't do anything Iterators
> don't,
> > it's hard to see why anyone would prefer the
> former.
> > Or was that just you safeguarding against the
> > inevitable "I prefer Enumerations" that's marching
> > toward this thread at some point :-)
>
> I guess I was :-)
> Where I go, there are regular arguments about the
> proper length of names, so I wouldn't be too sure.
> Admitted, though, never having used an Enumeration
> myself, I wasn't sure about the exact differences.
> Glad you contributed it!
Heh heh grumbly old beardie real ale developers no doubt! Seriously, is 'next' really so much more vague than 'nextElement'?