MCPcopy Create free account
hub / github.com/diyhi/bbs / addIfAbsent

Method addIfAbsent

src/main/java/cms/utils/ConcurrentHashSet.java:63–65  ·  view source on GitHub ↗

将元素添加到集合中,前提是该元素尚未加入集合 @param element 要添加到集合中的元素 @return 如果该集合尚未包含指定元素,则返回 true

(T element)

Source from the content-addressed store, hash-verified

61 * @return 如果该集合尚未包含指定元素,则返回 true
62 */
63 public boolean addIfAbsent(T element) {
64 return mMap.putIfAbsent(element, Boolean.TRUE) == null;
65 }
66
67 @Override
68 public void clear() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected