Example usage for org.joda.time MutablePeriod getDays

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

Introduction

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

Prototype

public int getDays() 

Source Link

Document

Gets the days field part 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
 * /*from  ww  w .ja  va2  s.  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();
}