Package org.goda.time

Examples of org.goda.time.DurationFieldType


     * Private method called from constructor.
     */
    private void setPeriodInternal(ReadablePeriod period) {
        int[] newValues = new int[size()];
        for (int i = 0, isize = period.size(); i < isize; i++) {
            DurationFieldType type = period.getFieldType(i);
            int value = period.getValue(i);
            checkAndUpdate(type, newValues, value);
        }
        iValues = newValues;
    }
View Full Code Here


     * @return the updated values
     * @throws IllegalArgumentException if an unsupported field's value is non-zero
     */
    protected int[] mergePeriodInto(int[] values, ReadablePeriod period) {
         for (int i = 0, isize = period.size(); i < isize; i++) {
             DurationFieldType type = period.getFieldType(i);
             int value = period.getValue(i);
             checkAndUpdate(type, values, value);
         }
         return values;
    }
View Full Code Here

     * @return the updated values
     * @throws IllegalArgumentException if an unsupported field's value is non-zero
     */
    protected int[] addPeriodInto(int[] values, ReadablePeriod period) {
         for (int i = 0, isize = period.size(); i < isize; i++) {
             DurationFieldType type = period.getFieldType(i);
             int value = period.getValue(i);
             if (value != 0) {
                 int index = indexOf(type);
                 if (index == -1) {
                     throw new IllegalArgumentException(
                         "Period does not support field '" + type.getName() + "'");
                 } else {
                     values[index] = FieldUtils.safeAdd(getValue(index), value);
                 }
             }
         }
View Full Code Here

TOP

Related Classes of org.goda.time.DurationFieldType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.