Examples of toDurationFrom()


Examples of org.joda.time.Period.toDurationFrom()

 
  public void testStringToDurationConversion() {
   
    final String responseSLA = "PT8H30M";
    final Period period = ISOPeriodFormat.standard().parsePeriod(responseSLA);
    final Duration duration = period.toDurationFrom(new DateTime());
    System.out.println(duration);
  }
 

}
View Full Code Here

Examples of org.joda.time.Period.toDurationFrom()

    {
            return null;
    }
        assertObjectImplementsType(Period.class, customFieldObject);
        Period period = (Period) customFieldObject;
        final Duration durationFrom = period.toDurationFrom(new DateTime());
    final Double dbVal = new Double(durationFrom.getMillis());

    return dbVal;
  }
View Full Code Here

Examples of org.joda.time.Period.toDurationFrom()

   * @param periodString
   * @return
   */
  private static Duration getDurationForISOPeriod(final String periodString) {
    final Period period = ISOPeriodFormat.standard().parsePeriod(periodString);
    final Duration duration = period.toDurationFrom(new DateTime());
    return duration;
  }

  /**
   * Calculate the elapsed time from the last calculated time up until the
View Full Code Here

Examples of org.joda.time.Period.toDurationFrom()

                    AggregateEvent next = iterator.next();
                    Interval gap = current.getSpan().gap(next.getSpan());

                    //if they overlap or gap is less one quarter timeUnitLength
                    //TODO: 1/4 factor is arbitrary. review! -jm
                    if (gap == null || gap.toDuration().getMillis() <= timeUnitLength.toDurationFrom(gap.getStart()).getMillis() / 4) {
                        //merge them
                        current = AggregateEvent.merge(current, next);
                    } else {
                        //done merging into current, set next as new current
                        aggEvents.add(current);
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.