MCPcopy Create free account
hub / github.com/apache/commons-lang / compareTo

Method compareTo

src/main/java/org/apache/commons/lang3/tuple/Pair.java:151–159  ·  view source on GitHub ↗

Compares the pair based on the left element followed by the right element. The types must be Comparable. @param other the other pair, not null. @return negative if this is less, zero if equal, positive if greater.

(final Pair<L, R> other)

Source from the content-addressed store, hash-verified

149 * @return negative if this is less, zero if equal, positive if greater.
150 */
151 @Override
152 public int compareTo(final Pair<L, R> other) {
153 // @formatter:off
154 return new CompareToBuilder()
155 .append(getLeft(), other.getLeft())
156 .append(getRight(), other.getRight())
157 .toComparison();
158 // @formatter:on
159 }
160
161 /**
162 * Compares this pair to another based on the two elements.

Callers 14

compareMethod · 0.45
compareMethod · 0.45
compareMethod · 0.45
exclusiveBetweenMethod · 0.45
inclusiveBetweenMethod · 0.45
compareMethod · 0.45
compareMethod · 0.45
equalToMethod · 0.45
greaterThanMethod · 0.45
greaterThanOrEqualToMethod · 0.45
lessThanMethod · 0.45
lessThanOrEqualToMethod · 0.45

Calls 4

getLeftMethod · 0.95
getRightMethod · 0.95
toComparisonMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected