• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

which class implements ListIterator

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jakarta's commons Collections implements it : ListIteratorWrapper
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic