本文整理汇总了Java中com.intellij.util.containers.ComparatorUtil.compareInt方法的典型用法代码示例。如果您正苦于以下问题:Java ComparatorUtil.compareInt方法的具体用法?Java ComparatorUtil.compareInt怎么用?Java ComparatorUtil.compareInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.containers.ComparatorUtil
的用法示例。
在下文中一共展示了ComparatorUtil.compareInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compareSuites
import com.intellij.util.containers.ComparatorUtil; //导入方法依赖的package包/类
private int compareSuites(final SMTestProxy suite1,
final SMTestProxy suite2) {
// Compare errors
final int errors1 = suite1.getChildren(ProxyFilters.FILTER_ERRORS).size();
final int errors2 = suite2.getChildren(ProxyFilters.FILTER_ERRORS).size();
final int errorsComparison = ComparatorUtil.compareInt(errors1, errors2);
// If not equal return it
if (errorsComparison != 0) {
return errorsComparison;
}
// Compare failures
final int failures1 = suite1.getChildren(ProxyFilters.FILTER_FAILURES).size();
final int failures2 = suite2.getChildren(ProxyFilters.FILTER_FAILURES).size();
final int failuresComparison = ComparatorUtil.compareInt(failures1, failures2);
// If not equal return it
if (failuresComparison != 0) {
return failuresComparison;
}
// otherwise check passed count
final int passed1 = suite1.getChildren(ProxyFilters.FILTER_PASSED).size();
final int passed2 = suite2.getChildren(ProxyFilters.FILTER_PASSED).size();
return ComparatorUtil.compareInt(passed1, passed2);
}
示例2: compareTests
import com.intellij.util.containers.ComparatorUtil; //导入方法依赖的package包/类
private int compareTests(final SMTestProxy test1, final SMTestProxy test2) {
// Rule1. For tests: NotRun < Ignored, etc < Passed < Failure < Error < Progress < Terminated
final int weight1 = test1.getMagnitudeInfo().getSortWeight();
final int weight2 = test2.getMagnitudeInfo().getSortWeight();
return ComparatorUtil.compareInt(weight1, weight2);
}