A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/NavigableMap.html below:

NavigableMap (Java SE 21 & JDK 21)

Type Parameters:
K - the type of keys maintained by this map
V - the type of mapped values
All Superinterfaces:
Map<K,V>, SequencedMap<K,V>, SortedMap<K,V>
All Known Subinterfaces:
ConcurrentNavigableMap<K,V>
All Known Implementing Classes:
ConcurrentSkipListMap, TreeMap
public interface NavigableMap<K,V> extends SortedMap<K,V>

A

SortedMap

extended with navigation methods returning the closest matches for given search targets. Methods

lowerEntry(K)

,

floorEntry(K)

,

ceilingEntry(K)

, and

higherEntry(K)

return

Map.Entry

objects associated with keys respectively less than, less than or equal, greater than or equal, and greater than a given key, returning

null

if there is no such key. Similarly, methods

lowerKey(K)

,

floorKey(K)

,

ceilingKey(K)

, and

higherKey(K)

return only the associated keys. All of these methods are designed for locating, not traversing entries.

A NavigableMap may be accessed and traversed in either ascending or descending key order. The descendingMap() method returns a view of the map with the senses of all relational and directional methods inverted. The performance of ascending operations and views is likely to be faster than that of descending ones. Methods subMap(K, boolean, K, boolean), headMap(K, boolean), and tailMap(K, boolean) differ from the like-named SortedMap methods in accepting additional arguments describing whether lower and upper bounds are inclusive versus exclusive. Submaps of any NavigableMap must implement the NavigableMap interface.

This interface additionally defines methods firstEntry(), pollFirstEntry(), lastEntry(), and pollLastEntry() that return and/or remove the least and greatest mappings, if any exist, else returning null.

The methods ceilingEntry(K), firstEntry(), floorEntry(K), higherEntry(K), lastEntry(), lowerEntry(K), pollFirstEntry(), and pollLastEntry() return Map.Entry instances that represent snapshots of mappings as of the time of the call. They do not support mutation of the underlying map via the optional setValue method.

Methods subMap(K, K), headMap(K), and tailMap(K) are specified to return SortedMap to allow existing implementations of SortedMap to be compatibly retrofitted to implement NavigableMap, but extensions and implementations of this interface are encouraged to override these methods to return NavigableMap. Similarly, SortedMap.keySet() can be overridden to return NavigableSet.

This interface is a member of the Java Collections Framework.

Since:
1.6

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4