Refine search
/** * <p>Compares the pair based on the left element followed by the right element. * The types must be {@code Comparable}.</p> * * @param other the other pair, not null * @return negative if this is less, zero if equal, positive if greater */ @Override public int compareTo(final Pair<L, R> other) { return new CompareToBuilder().append(getLeft(), other.getLeft()) .append(getRight(), other.getRight()).toComparison(); }
@Test public void testAppendSuper() { final TestObject o1 = new TestObject(4); final TestObject o2 = new TestObject(5); assertTrue(new CompareToBuilder().appendSuper(0).append(o1, o1).toComparison() == 0); assertTrue(new CompareToBuilder().appendSuper(0).append(o1, o2).toComparison() < 0); assertTrue(new CompareToBuilder().appendSuper(0).append(o2, o1).toComparison() > 0); assertTrue(new CompareToBuilder().appendSuper(-1).append(o1, o1).toComparison() < 0); assertTrue(new CompareToBuilder().appendSuper(-1).append(o1, o2).toComparison() < 0); assertTrue(new CompareToBuilder().appendSuper(1).append(o1, o1).toComparison() > 0); assertTrue(new CompareToBuilder().appendSuper(1).append(o1, o2).toComparison() > 0); }
public int compareTo(PeriodWrapper other) { return new CompareToBuilder() .append(period, other.period) .toComparison(); }
/** * Compares two vulnerabilities. * * @param v a vulnerability to be compared * @return a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified vulnerability */ @Override public int compareTo(Vulnerability v) { return new CompareToBuilder() .append(this.name, v.name) .toComparison(); }
@Override public int compareTo(TopicConflict other) { return new CompareToBuilder() .append(leftTopic, other.leftTopic) .append(rightTopic, other.rightTopic) .toComparison(); }
@Override public int compareTo(EmployeeConsecutiveAssignmentEnd other) { return new CompareToBuilder() .append(employee, other.employee) .append(shiftDate, other.shiftDate) .toComparison(); }
@Override public int compareTo(EmployeeConsecutiveWeekendAssignmentStart other) { return new CompareToBuilder() .append(employee, other.employee) .append(sundayIndex, other.sundayIndex) .toComparison(); }
@Override public int compareTo(EmployeeConsecutiveWeekendAssignmentEnd other) { return new CompareToBuilder() .append(employee, other.employee) .append(sundayIndex, other.sundayIndex) .toComparison(); }
@Override public int compareTo(CourseConflict other) { return new CompareToBuilder() .append(leftCourse, other.leftCourse) .append(rightCourse, other.rightCourse) .toComparison(); }
@Override public int compareTo(EmployeeConsecutiveAssignmentStart other) { return new CompareToBuilder() .append(employee, other.employee) .append(shiftDate, other.shiftDate) .toComparison(); }
/** * Used by the GUI to sort the {@link ConstraintMatch} list * by {@link ConstraintMatch#getJustificationList()}. * @param other never null * @return comparison */ @Override public int compareTo(MrMachineUsage other) { return new CompareToBuilder() .append(machineCapacity, other.machineCapacity) .append(usage, other.usage) .toComparison(); }
/** * Used by the GUI to sort the {@link ConstraintMatch} list * by {@link ConstraintMatch#getJustificationList()}. * @param other never null * @return comparison */ @Override public int compareTo(MrMachineTransientUsage other) { return new CompareToBuilder() .append(machineCapacity, other.machineCapacity) .append(usage, other.usage) .toComparison(); }
public int compareTo(IdleCost other) { return new CompareToBuilder() .append(machine, other.machine) .append(activePeriodAfterIdle, other.activePeriodAfterIdle) .append(cost, other.cost) .toComparison(); }
@Override public int compareTo(EmployeeWeekendSequence other) { return new CompareToBuilder() .append(employee, other.employee) .append(firstSundayIndex, other.firstSundayIndex) .append(lastSundayIndex, other.lastSundayIndex) .toComparison(); }
@Override public int compareTo(EmployeeFreeSequence other) { return new CompareToBuilder() .append(employee, other.employee) .append(firstDayIndex, other.firstDayIndex) .append(lastDayIndex, other.lastDayIndex) .toComparison(); }
@Override public int compareTo(EmployeeWorkSequence other) { return new CompareToBuilder() .append(employee, other.employee) .append(firstDayIndex, other.firstDayIndex) .append(lastDayIndex, other.lastDayIndex) .toComparison(); }
public int compareTo(MachinePeriodPart other) { return new CompareToBuilder() .append(machine, other.machine) .append(period, other.period) .append(active, other.active) .append(resourceAvailableList, other.resourceAvailableList) .toComparison(); }
/** * Used by the GUI to sort the {@link ConstraintMatch} list * by {@link ConstraintMatch#getJustificationList()}. * @param other never null * @return comparison */ @Override public int compareTo(AbstractPersistable other) { return new CompareToBuilder() .append(getClass().getName(), other.getClass().getName()) .append(id, other.id) .toComparison(); }
@Override public int compare(File a, File b) { String aLowerCaseName = a.getName().toLowerCase(Locale.US); String bLowerCaseName = b.getName().toLowerCase(Locale.US); return new CompareToBuilder() .append(a.getParent(), b.getParent(), ALPHA_NUMERIC_STRING_COMPARATOR) .append(a.isDirectory(), b.isDirectory()) .append(!aLowerCaseName.startsWith("demo"), !bLowerCaseName.startsWith("demo")) .append(aLowerCaseName, bLowerCaseName, ALPHA_NUMERIC_STRING_COMPARATOR) .append(a.getName(), b.getName()) .toComparison(); }
/** * Provides the natural ordering for FlowFile objects which is based on their identifier. * * @param other other * @return standard compare contract */ @Override public int compareTo(final FlowFile other) { return new CompareToBuilder().append(id, other.getId()).toComparison(); }