• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Iterator's method implementation

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a clarification on methods of Iterator interface. Iterator interface provides hasNext(), next() and remove() methods. From the Javadoc, class BeanContextSupport implements Iterator.

In collections like ArrayList, HashTable, HashSet, Vector we make use of those 3 methods to traverse through and remove objects. If you take ArrayList's hierarchy, I don't find BeanContextSupport in picture. In that case, which implementation does an ArrayList (or any collection) take for those 3 methods? Maybe a trivial question !!!

Thanks,
Sambhavi
 
Sheriff
Posts: 7346
1404
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Either java.util.ArrayList or java.util.AbstractList (the super class of ArrayList) may have a private inner class which is implemented from java.util.Iterator. In that case, it cannot be structured on JavaDoc, since JavaDoc is not supposed to provide the hierarchy structure for private inner class.
 
Oh the stink of it! Smell my tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic