Java – NavigableMap Interface

Java NavigableMap Interface methods, variables available in Java 8 release are listed below. We will publish example program on each methods ASAP.

Methods in Java NavigableMap Interface

S.No Method & Description
1 Map.Entry<K,V> ceilingEntry(K key)

Returns a key-value mapping associated with the least key greater than or equal to the given key, or null if there is no such key.
2 K ceilingKey(K key)

Returns the least key greater than or equal to the given key, or null if there is no such key.
3 NavigableSet<K> descendingKeySet()

Returns a reverse order NavigableSet view of the keys contained in this map.
4 NavigableMap<K,V> descendingMap()

Returns a reverse order view of the mappings contained in this map.
5 Map.Entry<K,V> firstEntry()

Returns a key-value mapping associated with the least key in this map, or null if the map is empty.
6 Map.Entry<K,V> floorEntry(K key)

Returns a key-value mapping associated with the greatest key less than or equal to the given key, or null if there is no such key.
7 K floorKey(K key)

Returns the greatest key less than or equal to the given key, or null if there is no such key.
8 SortedMap<K,V> headMap(K toKey)

Returns a view of the portion of this map whose keys are strictly less than toKey.
9 NavigableMap<K,V> headMap(K toKey, boolean inclusive)

Returns a view of the portion of this map whose keys are less than (or equal to, if inclusive is true) toKey.
10 Map.Entry<K,V> higherEntry(K key)

Returns a key-value mapping associated with the least key strictly greater than the given key, or null if there is no such key.
11 K higherKey(K key)

Returns the least key strictly greater than the given key, or null if there is no such key.
12 Map.Entry<K,V> lastEntry()

Returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.
13 Map.Entry<K,V> lowerEntry(K key)

Returns a key-value mapping associated with the greatest key strictly less than the given key, or null if there is no such key.
14 K lowerKey(K key)

Returns the greatest key strictly less than the given key, or null if there is no such key.
15 NavigableSet<K> navigableKeySet()

Returns a NavigableSet view of the keys contained in this map.
16 Map.Entry<K,V> pollFirstEntry()

Removes and returns a key-value mapping associated with the least key in this map, or null if the map is empty.
17 Map.Entry<K,V> pollLastEntry()

Removes and returns a key-value mapping associated with the greatest key in this map, or null if the map is empty.
18 NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)

Returns a view of the portion of this map whose keys range from fromKey to toKey.
19 SortedMap<K,V> subMap(K fromKey, K toKey)

Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.
20 SortedMap<K,V> tailMap(K fromKey)

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
21 NavigableMap<K,V> tailMap(K fromKey, boolean inclusive)

Returns a view of the portion of this map whose keys are greater than (or equal to, if inclusive is true) fromKey.

Ask your questions in eHowToNow Forum

Post your technical, non-technical doubts, questions in our site. Get answer as soon as possible, meanwhile you can help others by answering, unanswered questions.
To Ask new Question : Ask Question
Check our existing discussions : Questions & Answers

  1. Java – ConcurrentHashMap.KeySetView Class
  2. Java – ReentrantReadWriteLock Class
  3. Java – AtomicReferenceArray Class
  4. Java – CopyOnWriteArraySet Class
  5. Java – AtomicIntegerFieldUpdater Class
  6. java.util Package
  7. Java ArrayList clone() method with example
  8. Java – ConcurrentHashMap Class
  9. Java – LinkedTransferQueue Class
  10. Java – AbstractOwnableSynchronizer Class
  11. Java – CountedCompleter Class
  12. Java – StreamSupport Class
  13. Java – Comparable Interface
  14. Java – AtomicIntegerArray Class
  15. Java – AtomicLongArray Class

Be the first to comment

Leave a Reply