Example usage for org.joda.time MutablePeriod setDays

List of usage examples for org.joda.time MutablePeriod setDays

Introduction

In this page you can find the example usage for org.joda.time MutablePeriod setDays.

Prototype

public void setDays(int days) 

Source Link

Document

Sets the number of days of the period.

Usage

From source file:org.openehr.rm.datatypes.quantity.datetime.DvDuration.java

License:LGPL

/**
 * Helper method to negate a copy of period
 * /*  www  .  j  a va2s .c o m*/
 * @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();
}