List of usage examples for org.joda.time LocalDate compareTo
public int compareTo(ReadablePartial partial)
From source file:org.libreplan.business.planner.limiting.entities.Gap.java
License:Open Source License
private boolean canSatisfyStartConstraint(final LocalDate startsAfter) { return startsAfter.compareTo(startTime.getDate()) <= 0; }
From source file:org.libreplan.business.planner.limiting.entities.Gap.java
License:Open Source License
private boolean canSatisfyEndConstraint(LocalDate endsAfter) { return endTime == null || endsAfter.compareTo(endTime.getDate()) <= 0; }
From source file:org.libreplan.business.reports.dtos.CompletedEstimatedHoursPerTaskDTO.java
License:Open Source License
public EffortDuration calculateRealHours(Task task, LocalDate date) { EffortDuration result = EffortDuration.zero(); final List<WorkReportLine> workReportLines = workReportLineDAO .findByOrderElementAndChildren(task.getOrderElement()); if (workReportLines.isEmpty()) { return result; }//from w w w . j av a 2 s. c o m for (WorkReportLine workReportLine : workReportLines) { final LocalDate workReportLineDate = new LocalDate(workReportLine.getDate()); if (date == null || workReportLineDate.compareTo(date) <= 0) { result = EffortDuration.sum(result, workReportLine.getEffort()); } } return result; }
From source file:org.libreplan.business.reports.dtos.SchedulingProgressPerOrderDTO.java
License:Open Source License
public EffortDuration calculateRealHours(Order order, LocalDate date) { EffortDuration result = EffortDuration.zero(); final List<WorkReportLine> workReportLines = workReportLineDAO.findByOrderElementAndChildren(order); for (WorkReportLine workReportLine : workReportLines) { final LocalDate workReportLineDate = new LocalDate(workReportLine.getDate()); if (date == null || workReportLineDate.compareTo(date) <= 0) { result = EffortDuration.sum(result, workReportLine.getEffort()); }/*from w ww .j a va 2 s.c o m*/ } return result; }
From source file:org.libreplan.business.reports.dtos.WorkingArrangementsPerOrderDTO.java
License:Open Source License
public EffortDuration calculateRealHours(Task task, LocalDate date) { EffortDuration result = EffortDuration.zero(); final List<WorkReportLine> workReportLines = workReportLineDAO .findByOrderElementAndChildren(task.getOrderElement()); for (WorkReportLine workReportLine : workReportLines) { final LocalDate workReportLineDate = new LocalDate(workReportLine.getDate()); if (date == null || workReportLineDate.compareTo(date) <= 0) { result.plus(workReportLine.getEffort()); }//from w w w .j a v a 2 s . c om } return result; }
From source file:org.libreplan.business.reports.dtos.WorkingProgressPerTaskDTO.java
License:Open Source License
public EffortDuration calculateRealHours(Task task, LocalDate date) { EffortDuration result = EffortDuration.zero(); final List<WorkReportLine> workReportLines = workReportLineDAO .findByOrderElementAndChildren(task.getOrderElement()); if (workReportLines.isEmpty()) { return result; }//w w w . j a va2 s. c om for (WorkReportLine workReportLine : workReportLines) { final LocalDate workReportLineDate = new LocalDate(workReportLine.getDate()); if (date == null || workReportLineDate.compareTo(date) <= 0) { result = EffortDuration.sum(result, workReportLine.getEffort()); } } return result; }
From source file:org.libreplan.business.resources.entities.Interval.java
License:Open Source License
protected Interval(LocalDate start, LocalDate end) { Validate.notNull(start, "start date must be not null"); if (end != null) { Validate.isTrue(start.compareTo(end) <= 0, "start date must be equal or before than end date"); }// w ww . j av a 2 s. c om this.start = start; this.end = end; }
From source file:org.libreplan.business.resources.entities.Interval.java
License:Open Source License
@Override public boolean contains(LocalDate date) { return date.compareTo(start) >= 0 && date.compareTo(end) < 0; }
From source file:org.libreplan.business.resources.entities.Interval.java
License:Open Source License
@Override public boolean contains(LocalDate date) { return date.compareTo(start) >= 0; }
From source file:org.libreplan.business.resources.entities.LimitingResourceQueueElementComparator.java
License:Open Source License
private int compare(LocalDate arg0, LocalDate arg1) { if (arg0 == null) { return -1; }//from www . ja va 2 s. com if (arg1 == null) { return 1; } return arg0.compareTo(arg1); }