Package com.google.common.collect
Class ComparisonChain.InactiveComparisonChain
java.lang.Object
com.google.common.collect.ComparisonChain
com.google.common.collect.ComparisonChain.InactiveComparisonChain
- Enclosing class:
- ComparisonChain
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompare(double left, double right) Compares twodoublevalues as specified byDouble.compare(double, double), if the result of this comparison chain has not already been determined.compare(float left, float right) Compares twofloatvalues as specified byFloat.compare(float, float), if the result of this comparison chain has not already been determined.compare(int left, int right) Compares twointvalues as specified byInts.compare(int, int), if the result of this comparison chain has not already been determined.compare(long left, long right) Compares twolongvalues as specified byLongs.compare(long, long), if the result of this comparison chain has not already been determined.compare(Comparable<?> left, Comparable<?> right) Compares two comparable objects as specified byComparable.compareTo(T), if the result of this comparison chain has not already been determined.<T> ComparisonChaincompare(T left, T right, Comparator<T> comparator) Compares two objects using a comparator, if the result of this comparison chain has not already been determined.compareFalseFirst(boolean left, boolean right) Compares twobooleanvalues, consideringfalseto be less thantrue, if the result of this comparison chain has not already been determined.compareTrueFirst(boolean left, boolean right) Compares twobooleanvalues, consideringtrueto be less thanfalse, if the result of this comparison chain has not already been determined.intresult()Ends this comparison chain and returns its result: a value having the same sign as the first nonzero comparison result in the chain, or zero if every result was zero.Methods inherited from class com.google.common.collect.ComparisonChain
compare, start
-
Field Details
-
result
final int result
-
-
Constructor Details
-
InactiveComparisonChain
InactiveComparisonChain(int result)
-
-
Method Details
-
compare
Description copied from class:ComparisonChainCompares two comparable objects as specified byComparable.compareTo(T), if the result of this comparison chain has not already been determined.This method is declared to accept any 2
Comparableobjects, even if they are not mutually comparable. If you pass objects that are not mutually comparable, this method may throw an exception. (The reason for this decision is lost to time, but the reason might be that we wanted to support legacy classes that implement the raw typeComparable(instead of implementingComparable<Foo>) without producing warnings. If so, we would prefer today to produce warnings in that case, and we may change this method to do so in the future. Support for rawComparabletypes in Guava in general is tracked as #989.)- Specified by:
comparein classComparisonChain
-
compare
Description copied from class:ComparisonChainCompares two objects using a comparator, if the result of this comparison chain has not already been determined.- Specified by:
comparein classComparisonChain
-
compare
Description copied from class:ComparisonChainCompares twointvalues as specified byInts.compare(int, int), if the result of this comparison chain has not already been determined.- Specified by:
comparein classComparisonChain
-
compare
Description copied from class:ComparisonChainCompares twolongvalues as specified byLongs.compare(long, long), if the result of this comparison chain has not already been determined.- Specified by:
comparein classComparisonChain
-
compare
Description copied from class:ComparisonChainCompares twofloatvalues as specified byFloat.compare(float, float), if the result of this comparison chain has not already been determined.- Specified by:
comparein classComparisonChain
-
compare
Description copied from class:ComparisonChainCompares twodoublevalues as specified byDouble.compare(double, double), if the result of this comparison chain has not already been determined.- Specified by:
comparein classComparisonChain
-
compareTrueFirst
Description copied from class:ComparisonChainCompares twobooleanvalues, consideringtrueto be less thanfalse, if the result of this comparison chain has not already been determined.- Specified by:
compareTrueFirstin classComparisonChain
-
compareFalseFirst
Description copied from class:ComparisonChainCompares twobooleanvalues, consideringfalseto be less thantrue, if the result of this comparison chain has not already been determined.- Specified by:
compareFalseFirstin classComparisonChain
-
result
public int result()Description copied from class:ComparisonChainEnds this comparison chain and returns its result: a value having the same sign as the first nonzero comparison result in the chain, or zero if every result was zero.- Specified by:
resultin classComparisonChain
-