Package org.joda.time

Examples of org.joda.time.Interval.toDurationMillis()


      Interval overlap = test.overlap(interval.getInterval());
      if (overlap != null) {
        Double weight = interval.getWeight();
        if (weight != null) {
          double durationCheck = test.toDurationMillis();
          double durationOverlap = overlap.toDurationMillis();
          double avgWeight = (durationOverlap / durationCheck) * weight;
          preference += avgWeight;
        }
      }

View Full Code Here


      String end = activity.withStatus().getEnd();
      if (start != null && end != null) {
        DateTime startTime = new DateTime(start);
        DateTime endTime = new DateTime(end);
        Interval interval = new Interval(startTime, endTime);
        if (interval.toDurationMillis() != duration) {
          logger.info("status did not match constraints. "
              + "Changed end time to match the duration of "
              + duration + " ms");

          // duration does not match. adjust the end time
View Full Code Here

    // duration
    if (start != null && end != null) {
      Interval interval = new Interval(new DateTime(start), new DateTime(
          end));
      Long duration = interval.toDurationMillis();
      activity.withConstraints().withTime().setDuration(duration);
    }

    // location
    String location = null;
View Full Code Here

      Interval overlap = test.overlap(interval.getInterval());
      if (overlap != null) {
        Double weight = interval.getWeight();
        if (weight != null) {
          double durationCheck = test.toDurationMillis();
          double durationOverlap = overlap.toDurationMillis();
          double avgWeight = (durationOverlap / durationCheck) * weight;
          preference += avgWeight;
        }
      }

View Full Code Here

      String end = activity.withStatus().getEnd();
      if (start != null && end != null) {
        DateTime startTime = new DateTime(start);
        DateTime endTime = new DateTime(end);
        Interval interval = new Interval(startTime, endTime);
        if (interval.toDurationMillis() != duration) {
          logger.info("status did not match constraints. "
              + "Changed end time to match the duration of "
              + duration + " ms");

          // duration does not match. adjust the end time
View Full Code Here

    // duration
    if (start != null && end != null) {
      Interval interval = new Interval(new DateTime(start), new DateTime(
          end));
      Long duration = interval.toDurationMillis();
      activity.withConstraints().withTime().setDuration(duration);
    }

    // location
    String location = null;
View Full Code Here

      Interval overlap = test.overlap(interval.getInterval());
      if (overlap != null) {
        Double weight = interval.getWeight();
        if (weight != null) {
          double durationCheck = test.toDurationMillis();
          double durationOverlap = overlap.toDurationMillis();
          double avgWeight = (durationOverlap / durationCheck) * weight;
          preference += avgWeight;
        }
      }

View Full Code Here

    static public Interval getIntervalAround(DateTime aroundInstant, ReadablePeriod period) {
        DateTime start = aroundInstant.minus(period);
        DateTime end = aroundInstant.plus(period);
        Interval range = new Interval(start, end);
        DateTime middleOf = IntervalUtils.middleOf(range);
        long halfRange = range.toDurationMillis() / 4;
        final Interval newInterval = new Interval(middleOf.minus(halfRange), middleOf.plus(halfRange));
        return newInterval;
    }
}
View Full Code Here

        }
    }

    synchronized public void pushZoomOutTime() {
        final Interval timeRange = filteredEvents.timeRange().get();
        long toDurationMillis = timeRange.toDurationMillis() / 4;
        DateTime start = timeRange.getStart().minus(toDurationMillis);
        DateTime end = timeRange.getEnd().plus(toDurationMillis);
        pushTimeRange(new Interval(start, end));
    }
View Full Code Here

        pushTimeRange(new Interval(start, end));
    }

    synchronized public void pushZoomInTime() {
        final Interval timeRange = filteredEvents.timeRange().get();
        long toDurationMillis = timeRange.toDurationMillis() / 4;
        DateTime start = timeRange.getStart().plus(toDurationMillis);
        DateTime end = timeRange.getEnd().minus(toDurationMillis);
        pushTimeRange(new Interval(start, end));
    }
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.