• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

which class implements ListIterator  RSS feed

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
who needs to implement ListIterator ?programmer? or any inbilt java class?
i've refered to java API but there i havn't found any class implementing this interface

if possible ,can any one provide me nice implementation for this interface
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jakarta's commons Collections implements it : ListIteratorWrapper
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need someone to implement this for you? What kind of list should it iterate over? Do you have some particular project in mind where you need this?

The existence of this class is primarily useful along with the List interface. Notice that it has methods that return ListIterator. If you call any of these methods, you don't have to worry about who the concrete class is that implements this interface. You only need to know that this class certainly implements all the methods required by the ListIterator documentation.

So in the end, if you are using the standard Collections API, you don't need to worry about writing your own class to implement this interface. One exists already. However, if you are writing your own class to implement the List interface, then you probably need to create a companion class that implements ListIterator as well. I don't think someone will just do this for you.

Layne
 
author and iconoclast
Posts: 24203
43
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saikrishna --

In the Java Collections API, there are some methods that are declared to return an Iterator, and other that return a ListIterator. Without exception (at least, without exception that comes to mind) these methods return an instance of a private inner class of the Collection they're invoked on. Because an inner class has special access to the data of its outer class, they are ideally suited for implementing fast and efficient Iterators and ListIterators.
 
it's a teeny, tiny, wafer thin ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!