Example usage for org.joda.time MutablePeriod setWeeks

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

Introduction

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

Prototype

public void setWeeks(int weeks) 

Source Link

Document

Sets the number of weeks 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   w  ww  .j av a2  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();
}