/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
@Override public Period load(ParseableDurationForLocale parseableDurationForLocale) throws Exception { MutablePeriod period = new MutablePeriod(); PERIOD_PARSER.parseInto(period, parseableDurationForLocale.duration, 0, parseableDurationForLocale.locale); return period.toPeriod(); } });
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
@Override public Period load(ParseableDurationForLocale parseableDurationForLocale) throws Exception { MutablePeriod period = new MutablePeriod(); PERIOD_PARSER.parseInto(period, parseableDurationForLocale.duration, 0, parseableDurationForLocale.locale); return period.toPeriod(); } });
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
/** * Parses a period from the given text, returning a new Period. * * @param text text to parse * @return parsed value in a Period object * @throws IllegalArgumentException if any field is out of range */ public Period parsePeriod(String text) { checkParser(); return parseMutablePeriod(text).toPeriod(); }
System.out.println(formatter.print(parsedPeriod)); Duration theduration = parsedPeriod.toPeriod().toStandardDuration(); System.out.println("period in seconds: " + theduration.getStandardSeconds());
return period.toPeriod();
medication.getStringValue(Medication.DOSE), medication.getStringValue(Medication.FREQUENCY), p.toPeriod(), medication.getStringValue(Medication.EFFECT), medication.getLargeStringValue(Medication.NOTES)));
medication.getStringValue(Medication.DOSE), medication.getStringValue(Medication.FREQUENCY), p.toPeriod(), medication.getStringValue(Medication.EFFECT), medication.getLargeStringValue(Medication.NOTES)));
/** * Helper method to negate a copy of period * * @param mPeriod * @return a negated copy of period */ static Period negatePeriod(Period period) { MutablePeriod mPeriod = period.toMutablePeriod(); mPeriod.setYears(-mPeriod.getYears()); mPeriod.setMonths(-mPeriod.getMonths()); mPeriod.setWeeks(-mPeriod.getWeeks()); mPeriod.setDays(-mPeriod.getDays()); mPeriod.setHours(-mPeriod.getHours()); mPeriod.setMinutes(-mPeriod.getMinutes()); mPeriod.setSeconds(-mPeriod.getSeconds()); mPeriod.setMillis(-mPeriod.getMillis()); return mPeriod.toPeriod(); }
/** * Helper method to negate a copy of period * * @param mPeriod * @return a negated copy of period */ static Period negatePeriod(Period period) { MutablePeriod mPeriod = period.toMutablePeriod(); mPeriod.setYears(-mPeriod.getYears()); mPeriod.setMonths(-mPeriod.getMonths()); mPeriod.setWeeks(-mPeriod.getWeeks()); mPeriod.setDays(-mPeriod.getDays()); mPeriod.setHours(-mPeriod.getHours()); mPeriod.setMinutes(-mPeriod.getMinutes()); mPeriod.setSeconds(-mPeriod.getSeconds()); mPeriod.setMillis(-mPeriod.getMillis()); return mPeriod.toPeriod(); }