mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8159527: Collections mutator methods should all be marked as optional operations
Reviewed-by: naoto, bpb
This commit is contained in:
parent
873d117932
commit
b2add96c35
5 changed files with 62 additions and 53 deletions
|
@ -146,17 +146,23 @@ public interface NavigableSet<E> extends SortedSet<E> {
|
|||
|
||||
/**
|
||||
* Retrieves and removes the first (lowest) element,
|
||||
* or returns {@code null} if this set is empty.
|
||||
* or returns {@code null} if this set is empty (optional operation).
|
||||
*
|
||||
* @return the first element, or {@code null} if this set is empty
|
||||
*
|
||||
* @throws UnsupportedOperationException if the {@code pollFirst}
|
||||
* operation is not supported by this collection
|
||||
*/
|
||||
E pollFirst();
|
||||
|
||||
/**
|
||||
* Retrieves and removes the last (highest) element,
|
||||
* or returns {@code null} if this set is empty.
|
||||
* or returns {@code null} if this set is empty (optional operation).
|
||||
*
|
||||
* @return the last element, or {@code null} if this set is empty
|
||||
*
|
||||
* @throws UnsupportedOperationException if the {@code pollLast}
|
||||
* operation is not supported by this collection
|
||||
*/
|
||||
E pollLast();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue