Example usage for org.joda.time ReadablePartial get

List of usage examples for org.joda.time ReadablePartial get

Introduction

In this page you can find the example usage for org.joda.time ReadablePartial get.

Prototype

int get(DateTimeFieldType field);

Source Link

Document

Gets the value of one of the fields.

Usage

From source file:org.netxilia.api.utils.DateUtils.java

License:Open Source License

public static int getField(ReadablePartial partial, LocalDateTime fullDateTime, DateTimeFieldType field) {
    return partial.isSupported(field) ? partial.get(field) : fullDateTime.get(field);
}

From source file:org.powertac.common.Rate.java

License:Apache License

/**
 * Sets the day of the week on which this Rate comes into effect.
 * Process begin spec to extract dayOfWeek field
 *///from w w w  .j a  v a  2  s  .com
public Rate withWeeklyBegin(ReadablePartial begin) {
    if (null == begin) {
        log.error("Null value for weeklyBegin");
        weeklyBegin = NO_TIME;
        return null;
    }
    return withWeeklyBegin(begin.get(DateTimeFieldType.dayOfWeek()));
}

From source file:org.powertac.common.Rate.java

License:Apache License

/**
 * Sets the weekly end of applicability for this Rate,
 * by processing end spec to extract dayOfWeek field.
 *///from w ww  .  j  a va2  s. c om
public Rate withWeeklyEnd(ReadablePartial end) {
    if (end != null) {
        return withWeeklyEnd(end.get(DateTimeFieldType.dayOfWeek()));
    }
    return this;
}

From source file:org.powertac.common.Rate.java

License:Apache License

/**
 * Sets the time of day when this Rate comes into effect.
 *///from ww  w  .  java2  s  . co  m
public Rate withDailyBegin(ReadablePartial begin) {
    if (null == begin) {
        log.error("Null value for dailyBegin");
        dailyBegin = NO_TIME;
        return null;
    }
    return withDailyBegin(begin.get(DateTimeFieldType.hourOfDay()));
}

From source file:org.powertac.common.Rate.java

License:Apache License

/**
 * Sets the time of day when this Rate is no longer in effect.
 *//*from www.  j a v a 2 s . c o m*/
public Rate withDailyEnd(ReadablePartial end) {
    if (null == end) {
        log.error("Null value for dailyEnd");
        dailyEnd = NO_TIME;
        return null;
    }
    return withDailyEnd(end.get(DateTimeFieldType.hourOfDay()));
}