Examples of toDurationMillis()


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

      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

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

    // 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

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

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

    // add aggregated events as well
    this.eventAggregations.add(se);
    Interval eventinterval = new Interval(this.simTime.getMillis(), se.getEndTime());

    long durationvalue = eventinterval.toDurationMillis();
    if(intervalUnit.equals("seconds")) {
      durationvalue = durationvalue / 1000;
    } else if(intervalUnit.equals("minutes")) {
      durationvalue = durationvalue / (1000*60);
    } else if(intervalUnit.equals("hours")) {
View Full Code Here

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

    /** gap is null if the two segment intervals overlap or if they're adjacent */
    if (gap == null) {
      gapPenalty = 2;
    } else {
      long gapMillis = gap.toDurationMillis();
      if (gapMillis < THIRTY_DAYS_IN_MILLIS) {
        gapPenalty = 2 - gapMillis / THIRTY_DAYS_IN_MILLIS;
      }
    }

View Full Code Here

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

    @Override
    protected void finished(Description description) {
        this.end = new DateTime();
        Interval interval = new Interval(start, end);
        if ( interval.toDurationMillis() / 1000 > 3 ){
            Logger.debug("\u001B[0;35m" + description.getMethodName() + ": " + interval.toDurationMillis() / 1000 + " sec\u001B[0m");
        } else {
            Logger.debug(description.getMethodName() + ": " + interval.toDurationMillis() / 1000 + " sec");
        }
    }
View Full Code Here

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

    @Override
    protected void finished(Description description) {
        this.end = new DateTime();
        Interval interval = new Interval(start, end);
        if ( interval.toDurationMillis() / 1000 > 3 ){
            Logger.debug("\u001B[0;35m" + description.getMethodName() + ": " + interval.toDurationMillis() / 1000 + " sec\u001B[0m");
        } else {
            Logger.debug(description.getMethodName() + ": " + interval.toDurationMillis() / 1000 + " sec");
        }
    }
}
View Full Code Here

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

        this.end = new DateTime();
        Interval interval = new Interval(start, end);
        if ( interval.toDurationMillis() / 1000 > 3 ){
            Logger.debug("\u001B[0;35m" + description.getMethodName() + ": " + interval.toDurationMillis() / 1000 + " sec\u001B[0m");
        } else {
            Logger.debug(description.getMethodName() + ": " + interval.toDurationMillis() / 1000 + " sec");
        }
    }
}
View Full Code Here

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

      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

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

    // 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
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.