Example usage for org.joda.time MutablePeriod getWeeks

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

Introduction

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

Prototype

public int getWeeks() 

Source Link

Document

Gets the weeks 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
 * //  w w w.ja  va 2 s. co 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();
}