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

Method firstNode

corpus/java/training/guava/collect/TreeMultiset.java:364–385  ·  view source on GitHub ↗

Returns the first node in the tree that is in range.

()

Source from the content-addressed store, hash-verified

362 * Returns the first node in the tree that is in range.
363 */
364 @Nullable
365 private AvlNode<E> firstNode() {
366 AvlNode<E> root = rootReference.get();
367 if (root == null) {
368 return null;
369 }
370 AvlNode<E> node;
371 if (range.hasLowerBound()) {
372 E endpoint = range.getLowerEndpoint();
373 node = rootReference.get().ceiling(comparator(), endpoint);
374 if (node == null) {
375 return null;
376 }
377 if (range.getLowerBoundType() == BoundType.OPEN
378 && comparator().compare(endpoint, node.getElement()) == 0) {
379 node = node.succ;
380 }
381 } else {
382 node = header.succ;
383 }
384 return (node == header || !range.contains(node.getElement())) ? null : node;
385 }
386
387 @Nullable
388 private AvlNode<E> lastNode() {

Callers 1

entryIteratorMethod · 0.95

Calls 9

getMethod · 0.65
comparatorMethod · 0.65
getElementMethod · 0.65
containsMethod · 0.65
hasLowerBoundMethod · 0.45
getLowerEndpointMethod · 0.45
ceilingMethod · 0.45
getLowerBoundTypeMethod · 0.45
compareMethod · 0.45

Tested by

no test coverage detected