Java – SortedMap Interface

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

Methods in Java SortedMap Interface

S.No Method & Description
1 Comparator<? super K> comparator()

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.
2 Set<Map.Entry<K,V>> entrySet()

Returns a Set view of the mappings contained in this map.
3 K firstKey()

Returns the first (lowest) key currently in this map.
4 SortedMap<K,V> headMap(K toKey)

Returns a view of the portion of this map whose keys are strictly less than toKey.
5 Set<K> keySet()

Returns a Set view of the keys contained in this map.
6 K lastKey()

Returns the last (highest) key currently in this map.
7 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.
8 SortedMap<K,V> tailMap(K fromKey)

Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
9 Collection<V> values()

Returns a Collection view of the values contained in this map.

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 – IntSupplier Interface
  2. Java – HashMap Class
  3. Java – ConcurrentMap Interface
  4. Java – CountedCompleter Class
  5. Java – Exchanger Class
  6. Java – CompletionService Interface
  7. Java – AbstractOwnableSynchronizer Class
  8. Java ArrayList add(int index, E element) method with example
  9. Java – ServiceLoader Class
  10. Java – IntUnaryOperator Interface
  11. Java – ForkJoinTask Class
  12. Java – Objects Class in Util Package
  13. Java – AtomicReference Class
  14. Java – SplittableRandom Class
  15. Java – ConcurrentHashMap Class

Be the first to comment

Leave a Reply