Example usage for org.joda.time PeriodType size

List of usage examples for org.joda.time PeriodType size

Introduction

In this page you can find the example usage for org.joda.time PeriodType size.

Prototype

public int size() 

Source Link

Document

Gets the number of fields in the period type.

Usage

From source file:net.sourceforge.fenixedu.presentationTier.renderers.DurationRenderer.java

License:Open Source License

private DurationFieldType[] getDurationFieldTypes() {
    List<DurationFieldType> result = new ArrayList<DurationFieldType>();
    if (getIncludedFields() == null) {
        result.add(DurationFieldType.hours());
        result.add(DurationFieldType.minutes());
    } else {/*from   w ww . j a va  2 s .  c om*/
        PeriodType standard = PeriodType.standard();
        for (int index = 0; index < standard.size(); index++) {
            if (getIncludedFields().contains(standard.getFieldType(index).getName())) {
                result.add(standard.getFieldType(index));
            }
        }
    }
    return result.toArray(new DurationFieldType[] {});
}