Package org.jboss.logging.processor.util
Class Comparison.DeadComparison
- java.lang.Object
-
- org.jboss.logging.processor.util.Comparison
-
- org.jboss.logging.processor.util.Comparison.DeadComparison
-
- Enclosing class:
- Comparison
private static final class Comparison.DeadComparison extends Comparison
-
-
Field Summary
Fields Modifier and Type Field Description private intresult-
Fields inherited from class org.jboss.logging.processor.util.Comparison
EQUAL, GREATER, LESS
-
-
Constructor Summary
Constructors Constructor Description DeadComparison(int result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparisoncompare(boolean left, boolean right)Compares the left boolean to the double boolean.Comparisoncompare(double left, double right)Compares the left double to the double integer.Comparisoncompare(float left, float right)Compares the left float to the float integer.Comparisoncompare(int left, int right)Compares the left integer to the right integer.Comparisoncompare(long left, long right)Compares the left long to the right long.Comparisoncompare(java.lang.Comparable<?> left, java.lang.Comparable<?> right)Compares the left comparable to the right as specified by theComparable.compareTo(Object)interface.<T> Comparisoncompare(T left, T right, java.util.Comparator<T> comparator)Compares the left object to the right object as specified by theComparator.compare(Object, Object)interface.ComparisongetInstance()Returns the comparison instance being used.intresult()Ends the comparison and returns 0 if all comparisons were equal, -1 if the any of the left comparisons were less than the right comparisons or 1 if any of the right comparisons were less than the left.-
Methods inherited from class org.jboss.logging.processor.util.Comparison
begin, beginAllowNull
-
-
-
-
Method Detail
-
compare
public Comparison compare(java.lang.Comparable<?> left, java.lang.Comparable<?> right)
Description copied from class:ComparisonCompares the left comparable to the right as specified by theComparable.compareTo(Object)interface.- Specified by:
comparein classComparison- Parameters:
left- the object to compare to the right.right- the object compared to the left.- Returns:
- the the same instance if the objects are equal, otherwise a comparison that will return a defined value.
-
compare
public <T> Comparison compare(T left, T right, java.util.Comparator<T> comparator)
Description copied from class:ComparisonCompares the left object to the right object as specified by theComparator.compare(Object, Object)interface.- Specified by:
comparein classComparison- Type Parameters:
T- the type of the object to the compared.- Parameters:
left- the object to compare to the right.right- the object compared to the left.comparator- the comparator used to compare the objects.- Returns:
- the the same instance if the objects are equal, otherwise a comparison that will return a defined value.
-
compare
public Comparison compare(int left, int right)
Description copied from class:ComparisonCompares the left integer to the right integer.- Overrides:
comparein classComparison- Parameters:
left- the integer to compare to the right.right- the integer compared to the left.- Returns:
- the the same instance if the integers are equal, otherwise a comparison that will return a defined value.
-
compare
public Comparison compare(long left, long right)
Description copied from class:ComparisonCompares the left long to the right long.- Overrides:
comparein classComparison- Parameters:
left- the long to compare to the right.right- the long compared to the left.- Returns:
- the the same instance if the longs are equal, otherwise a comparison that will return a defined value.
-
compare
public Comparison compare(float left, float right)
Description copied from class:ComparisonCompares the left float to the float integer.- Overrides:
comparein classComparison- Parameters:
left- the float to compare to the right.right- the float compared to the left.- Returns:
- the the same instance if the floats are equal, otherwise a comparison that will return a defined value.
-
compare
public Comparison compare(double left, double right)
Description copied from class:ComparisonCompares the left double to the double integer.- Overrides:
comparein classComparison- Parameters:
left- the double to compare to the right.right- the double compared to the left.- Returns:
- the the same instance if the doubles are equal, otherwise a comparison that will return a defined value.
-
compare
public Comparison compare(boolean left, boolean right)
Description copied from class:ComparisonCompares the left boolean to the double boolean.- Overrides:
comparein classComparison- Parameters:
left- the boolean to compare to the right.right- the boolean compared to the left.- Returns:
- the the same instance if the booleans are equal, otherwise a comparison that will return a defined value.
-
result
public int result()
Description copied from class:ComparisonEnds the comparison and returns 0 if all comparisons were equal, -1 if the any of the left comparisons were less than the right comparisons or 1 if any of the right comparisons were less than the left.- Overrides:
resultin classComparison- Returns:
- zero if equal, otherwise the a value with the same sign as the first non-equal comparison.
-
getInstance
public Comparison getInstance()
Description copied from class:ComparisonReturns the comparison instance being used.- Specified by:
getInstancein classComparison- Returns:
- the comparison instance being used.
-
-