Package org.joda.time

Examples of org.joda.time.Duration.plus()


          workingHours = workingHours.withEnd(now);
        } else if (workingHours.getEnd().isBefore(now)) {
          // leave end of working hours as is
        }
      }
      duration = duration.plus(workingHours.toDuration());
      dateBeingProcessed = dateBeingProcessed.plusDays(1);
      processingInterval = getEntireDayIntervalForDate(dateBeingProcessed);
    }
    System.out.println(duration.toPeriod());
    return duration;
View Full Code Here


  {
    if (duration == null) {
      Duration totalDuration = new Duration(0);
      for (Interval interval : querySegmentSpec.getIntervals()) {
        if (interval != null) {
          totalDuration = totalDuration.plus(interval.toDuration());
        }
      }
      duration = totalDuration;
    }
View Full Code Here

    @JsonIgnore
    public long getDuration(TimeUnit timeUnit) {
        Duration d = new Duration(0);
        for (int i = 0; i < legs.size(); i++) {
            RouteScheduleDto current = legs.get(i).departure.getSchedule();
            d = d.plus(getDifference(current.getDepartureTime(), current.getArrivalTime()));
            if ( i < legs.size()-1 ) {
                RouteScheduleDto next = legs.get(i+1).departure.getSchedule();
                d = d.plus(getDifference(current.getArrivalTime(), next.getDepartureTime()));
            }
        }
View Full Code Here

        for (int i = 0; i < legs.size(); i++) {
            RouteScheduleDto current = legs.get(i).departure.getSchedule();
            d = d.plus(getDifference(current.getDepartureTime(), current.getArrivalTime()));
            if ( i < legs.size()-1 ) {
                RouteScheduleDto next = legs.get(i+1).departure.getSchedule();
                d = d.plus(getDifference(current.getArrivalTime(), next.getDepartureTime()));
            }
        }
        return timeUnit.convert(d.getMillis(), TimeUnit.MILLISECONDS);
    }
View Full Code Here

    public AvailableScheduleDto departure;

    @JsonIgnore
    public long getDuration(TimeUnit timeUnit) {
        Duration d = new Duration(0);
        d = d.plus(AvailablePathDto.getDifference(departure.schedule.getDepartureTime(), departure.schedule.getArrivalTime()));
        return timeUnit.convert(d.getMillis(), TimeUnit.MILLISECONDS);
    }
}
View Full Code Here

    }

    public Duration getTotalShiftsDuration() {
        Duration totalDuration = Duration.ZERO;
        for (Shift shift : getAssociatedShifts()) {
            totalDuration = totalDuration.plus(shift.getTotalDuration());
        }
        return totalDuration;
    }

    public BigDecimal getAllShiftUnitHours(ShiftType shiftType) {
View Full Code Here

    public Duration getTotalDuration() {
        Duration duration = Duration.ZERO;
        Collection<Lesson> lessons = getAssociatedLessonsSet();
        for (Lesson lesson : lessons) {
            duration = duration.plus(lesson.getTotalDuration());
        }
        return duration;
    }

    public BigDecimal getMaxLessonDuration() {
View Full Code Here

    do {
      boolean res = predicate.apply(null);
      if (res) {
        return true;
      } else {
        d = d.plus(interval);
       
        // TODO: Take execution time into account...
        ThreadUtils.sleep(interval.getMillis());
      }
    } while (d.isShorterThan(timeout));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.