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

Method firstNode

output/java_guava/1.4.16/TreeMultiset.java:371–393  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

369 */
370
371 @Nullable
372 private AvlNode<E> firstNode() {
373 AvlNode<E> root = rootReference.get();
374 if (root == null) {
375 return null;
376 }
377 AvlNode<E> node;
378 if (range.hasLowerBound()) {
379 E endpoint = range.getLowerEndpoint();
380 node = rootReference.get().ceiling(comparator(), endpoint);
381 if (node == null) {
382 return null;
383 }
384
385 if (range.getLowerBoundType() == BoundType.OPEN
386 && comparator().compare(endpoint, node.getElement()) == 0) {
387 node = node.succ;
388 }
389 } else {
390 node = header.succ;
391 }
392 return (node == header || !range.contains(node.getElement())) ? null : node;
393 }
394
395 @Nullable
396 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