Java 6 Navigable Interfaces: What's in Them for Me?
A Java developer determines where in a real development scenario he would use the two new navigable interfaces in Java SE 6, NavigableSet and NavigableMap, and comes away a bit disappointed.
by Narendra Venkataraman
February 27, 2007
hen I heard about the two new navigable interfaces, NavigableSet and NavigableMap, that were going to be released with the collections framework in Java SE 6, I wondered how I would have used them in my previous Java implementations. If the navigable interfaces sounded like some GPS library classes to you, you're not aloneI thought the same thing. Actually, navigable interfaces provide methods to retrieve a view of either a map based on a range of keys or a subset of a set based on a range of entries.
ConcurrentSkipListMap and TreeMap implement the NavigableMap interface, while ConcurrentSkipListSet and TreeSet implement the NavigableSet interface. TreeSet is implemented on top of TreeMap and ConcurrentSkipListSet using ConcurrentSkipListMap.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!