Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: enumeration...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 16002 of 16268
Post > Topic >>

Re: enumeration question

by Hendrik Maryns <gtw37bn02@[EMAIL PROTECTED] > Apr 22, 2008 at 12:43 PM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hendrik Maryns schreef:
| a schreef:
| | Hi
| |
| | How can I get back to the first element after fini****ng the while loop
| with
| | enum.hasMoreElements()?
|
| You can’t.  You can, however, ask for a new Enumerator.  However, note
| that Enumerator is obsolete, and has been replaced by Iterator.  Please
| use that in your own code, as far as possible.

And then you’ll see that there is ListIterator, in which you can also go
back, and thus to the first element.

Jakarta Commons Collections offers a lot of interesting cl*****
implementing Iterator, such as LoopingIterator, which might be what you
are looking for.  However, it is not available with generics yet.  I can
send you a generified version if you want.

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIDcFhe+7xMGD3itQRAuebAJ9S6oA5r86lsLxn1od6drfbAcikYQCeKOfz
nLYBPjfarVX5HkOdLH9AHto=
=QbWK
-----END PGP SIGNATURE-----
 




 5 Posts in Topic:
enumeration question
"a" <a@[EMAI  2008-04-22 08:50:13 
Re: enumeration question
Hendrik Maryns <gtw37b  2008-04-22 11:28:51 
Re: enumeration question
Hendrik Maryns <gtw37b  2008-04-22 12:43:45 
Re: enumeration question
Roedy Green <see_websi  2008-04-22 12:24:57 
Re: enumeration question
xinxin <jnzhouxinxin@[  2008-04-22 06:18:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 17:45:05 CDT 2008.