Java 6 Navigable Set Tutorial for Beginners

Navigable Set Interface is added in Java 6 (1.6). It is the part of Java Collection Framework.

Salient Point of Navigable Set

  • Navigable Set can be accessed and Traversed in ascending or descending order.
  • Performance of Ascending operation is likely to be faster than descending.

 

Important Methods in Navigable Set

  • Lower(E e) : Returns the greatest element in this set which is less than the given element or NULL if there is no such element.
  • Floor(E e ) : Returns the greatest element in this set which is less than or equal to given element or NULL if there is no such element.
  • Ceiling(E e) : Returns the least element in this set which is greater than or equal to given element or NULL if there is no such element.
  • Higher(E e) : Returns the least element in this set which is greater than the given element or NULL if there is no such element.
  • pollFirst() : Retrieve and remove the first least element. Or return null if there is no such element.
  • pollLast() : Retrieve and remove the last highest element. Or return null if there is no such element.
By | 2013-02-16T06:42:09+00:00 February 16th, 2013|Core Java|0 Comments

About the Author:

Leave A Comment