8266571: Sequenced Collections

Reviewed-by: alanb
This commit is contained in:
Stuart Marks 2023-04-25 15:19:08 +00:00
parent bad6aa68e4
commit 17ce0976e4
42 changed files with 7060 additions and 150 deletions

View file

@ -429,4 +429,20 @@ public interface NavigableMap<K,V> extends SortedMap<K,V> {
* @throws IllegalArgumentException {@inheritDoc}
*/
SortedMap<K,V> tailMap(K fromKey);
/**
* {@inheritDoc}
* <p>
* This method is equivalent to {@link #descendingMap descendingMap}.
*
* @implSpec
* The implementation in this interface returns the result of calling the
* {@code descendingMap} method.
*
* @return a reverse-ordered view of this map, as a {@code NavigableMap}
* @since 21
*/
default NavigableMap<K, V> reversed() {
return this.descendingMap();
}
}