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

Method isStrictlyOrdered

output/java_guava/1.4.18/Ordering.java:947–960  ·  view source on GitHub ↗

Returns true if each element in iterable after the first is strictly greater than the element that preceded it, according to this ordering. Note that this is always true when the iterable has fewer than two elements.

(Iterable<? extends T> iterable)

Source from the content-addressed store, hash-verified

945
946
947 public boolean isStrictlyOrdered(Iterable<? extends T> iterable) {
948 Iterator<? extends T> it = iterable.iterator();
949 if (it.hasNext()) {
950 T prev = it.next();
951 while (it.hasNext()) {
952 T next = it.next();
953 if (compare(prev, next) >= 0) {
954 return false;
955 }
956 prev = next;
957 }
958 }
959 return true;
960 }
961
962 /**
963 * {@link Collections#binarySearch(List, Object, Comparator) Searches}

Callers

nothing calls this directly

Calls 4

compareMethod · 0.95
iteratorMethod · 0.65
nextMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected