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
private static final class ComparisonChain.InactiveComparisonChain extends ComparisonChain
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
result
-
Constructor Summary
Constructors Constructor Description InactiveComparisonChain(int result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComparisonChain
compare(double left, double right)
Compares twodouble
values as specified byDouble.compare(double, double)
, if the result of this comparison chain has not already been determined.ComparisonChain
compare(float left, float right)
Compares twofloat
values as specified byFloat.compare(float, float)
, if the result of this comparison chain has not already been determined.ComparisonChain
compare(int left, int right)
Compares twoint
values as specified byInts.compare(int, int)
, if the result of this comparison chain has not already been determined.ComparisonChain
compare(long left, long right)
Compares twolong
values as specified byLongs.compare(long, long)
, if the result of this comparison chain has not already been determined.ComparisonChain
compare(java.lang.Comparable left, java.lang.Comparable right)
Compares two comparable objects as specified byComparable.compareTo(T)
, if the result of this comparison chain has not already been determined.<T> ComparisonChain
compare(T left, T right, java.util.Comparator<T> comparator)
Compares two objects using a comparator, if the result of this comparison chain has not already been determined.ComparisonChain
compareFalseFirst(boolean left, boolean right)
Compares twoboolean
values, consideringfalse
to be less thantrue
, if the result of this comparison chain has not already been determined.ComparisonChain
compareTrueFirst(boolean left, boolean right)
Compares twoboolean
values, consideringtrue
to be less thanfalse
, if the result of this comparison chain has not already been determined.int
result()
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
-
-
-
-
Method Detail
-
compare
public ComparisonChain compare(java.lang.Comparable left, java.lang.Comparable right)
Description copied from class:ComparisonChain
Compares two comparable objects as specified byComparable.compareTo(T)
, if the result of this comparison chain has not already been determined.- Specified by:
compare
in classComparisonChain
-
compare
public <T> ComparisonChain compare(T left, T right, java.util.Comparator<T> comparator)
Description copied from class:ComparisonChain
Compares two objects using a comparator, if the result of this comparison chain has not already been determined.- Specified by:
compare
in classComparisonChain
-
compare
public ComparisonChain compare(int left, int right)
Description copied from class:ComparisonChain
Compares twoint
values as specified byInts.compare(int, int)
, if the result of this comparison chain has not already been determined.- Specified by:
compare
in classComparisonChain
-
compare
public ComparisonChain compare(long left, long right)
Description copied from class:ComparisonChain
Compares twolong
values as specified byLongs.compare(long, long)
, if the result of this comparison chain has not already been determined.- Specified by:
compare
in classComparisonChain
-
compare
public ComparisonChain compare(float left, float right)
Description copied from class:ComparisonChain
Compares twofloat
values as specified byFloat.compare(float, float)
, if the result of this comparison chain has not already been determined.- Specified by:
compare
in classComparisonChain
-
compare
public ComparisonChain compare(double left, double right)
Description copied from class:ComparisonChain
Compares twodouble
values as specified byDouble.compare(double, double)
, if the result of this comparison chain has not already been determined.- Specified by:
compare
in classComparisonChain
-
compareTrueFirst
public ComparisonChain compareTrueFirst(boolean left, boolean right)
Description copied from class:ComparisonChain
Compares twoboolean
values, consideringtrue
to be less thanfalse
, if the result of this comparison chain has not already been determined.- Specified by:
compareTrueFirst
in classComparisonChain
-
compareFalseFirst
public ComparisonChain compareFalseFirst(boolean left, boolean right)
Description copied from class:ComparisonChain
Compares twoboolean
values, consideringfalse
to be less thantrue
, if the result of this comparison chain has not already been determined.- Specified by:
compareFalseFirst
in classComparisonChain
-
result
public int result()
Description copied from class:ComparisonChain
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.- Specified by:
result
in classComparisonChain
-
-