Skip to content

Commit

Permalink
Update javadoc re: entry/key/value iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
jhalterman committed Sep 30, 2023
1 parent c5e0042 commit 543c92e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/net/jodah/expiringmap/ExpiringMap.java
Expand Up @@ -691,6 +691,11 @@ public boolean containsValue(Object value) {
}
}

/**
* Returns a copy of the map's entries, which can be iterated over safely by multiple threads.
*
* @return Copied set of map entries.
*/
@Override
public Set<Map.Entry<K, V>> entrySet() {
return new AbstractSet<Map.Entry<K, V>>() {
Expand Down Expand Up @@ -870,6 +875,11 @@ public boolean isEmpty() {
}
}

/**
* Returns a copy of the map's keys, which can be iterated over safely by multiple threads.
*
* @return Copied set of map keys.
*/
@Override
public Set<K> keySet() {
return new AbstractSet<K>() {
Expand Down Expand Up @@ -1191,6 +1201,11 @@ public String toString() {
}
}

/**
* Returns a copy of the map's values, which can be iterated over safely by multiple threads.
*
* @return Copied set of map values.
*/
@Override
public Collection<V> values() {
return new AbstractCollection<V>() {
Expand Down

0 comments on commit 543c92e

Please sign in to comment.