MCPcopy Create free account
hub / github.com/antlr/codebuff / setCount

Method setCount

output/java_guava/1.4.17/TreeMultiset.java:304–323  ·  view source on GitHub ↗
(@Nullable E element, int count)

Source from the content-addressed store, hash-verified

302 }
303
304 @CanIgnoreReturnValue
305 @Override
306 public int setCount(@Nullable E element, int count) {
307 checkNonnegative(count, "count");
308 if (!range.contains(element)) {
309 checkArgument(count == 0);
310 return 0;
311 }
312 AvlNode<E> root = rootReference.get();
313 if (root == null) {
314 if (count > 0) {
315 add(element, count);
316 }
317 return 0;
318 }
319 int[] result = new int[1]; // used as a mutable int reference to hold result
320 AvlNode<E> newRoot = root.setCount(comparator(), element, count, result);
321 rootReference.checkAndSet(root, newRoot);
322 return result[0];
323 }
324
325 @CanIgnoreReturnValue
326 @Override

Callers 1

removeMethod · 0.95

Calls 8

addMethod · 0.95
containsMethod · 0.65
getMethod · 0.65
setCountMethod · 0.65
comparatorMethod · 0.65
checkNonnegativeMethod · 0.45
checkArgumentMethod · 0.45
checkAndSetMethod · 0.45

Tested by

no test coverage detected