File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

navigable set and sorted set

 
Prasad Kharkar
Ranch Hand
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between navigable set and sorted set?
 
Rajeev Rnair
Ranch Hand
Posts: 308
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prasad Kharkar wrote:what is the difference between navigable set and sorted set?

please go through JAVA 6 API here ..

SortedSet<E> is the super interface of NavigableSet<E> and is a sub interface of Set<E>
or in other words, Iterable<E> -> Collection<E> -> Set <E> -> SortedSet<E> -> NavigableSet<E> -> TreeSet<E> is the inheritance tree.
TreeSet<E> implements NavigableSet<E>

SortedSet<E> ss = TreeSet<E> ts. headSet(E element) // This returns a SortedSet
where as
NavigableSet<E> ns = TreeSet<E> ts.headSet(E element, boolean b) // this returns a Navigable Set

this is same with tailSet() and subSet() which are in SCJP6 objectives!

hope this is clear
 
Karthik Shiraly
Bartender
Pie
Posts: 1059
24
Android C++ Java Linux PHP Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah no, ignore my previous post. I got it quite wrong!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic