Java Code Examples for java.time.temporal.ChronoField#range()

The following examples show how to use java.time.temporal.ChronoField#range() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HijrahChronology.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    checkCalendarInit();
    if (field instanceof ChronoField) {
        ChronoField f = field;
        switch (f) {
            case DAY_OF_MONTH:
                return ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
            case DAY_OF_YEAR:
                return ValueRange.of(1, getMaximumDayOfYear());
            case ALIGNED_WEEK_OF_MONTH:
                return ValueRange.of(1, 5);
            case YEAR:
            case YEAR_OF_ERA:
                return ValueRange.of(getMinimumYear(), getMaximumYear());
            case ERA:
                return ValueRange.of(1, 1);
            default:
                return field.range();
        }
    }
    return field.range();
}
 
Example 2
Source File: HijrahChronology.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    checkCalendarInit();
    if (field instanceof ChronoField) {
        ChronoField f = field;
        switch (f) {
            case DAY_OF_MONTH:
                return ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
            case DAY_OF_YEAR:
                return ValueRange.of(1, getMaximumDayOfYear());
            case ALIGNED_WEEK_OF_MONTH:
                return ValueRange.of(1, 5);
            case YEAR:
            case YEAR_OF_ERA:
                return ValueRange.of(getMinimumYear(), getMaximumYear());
            case ERA:
                return ValueRange.of(1, 1);
            default:
                return field.range();
        }
    }
    return field.range();
}
 
Example 3
Source File: HijrahChronology.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    checkCalendarInit();
    if (field instanceof ChronoField) {
        ChronoField f = field;
        switch (f) {
            case DAY_OF_MONTH:
                return ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
            case DAY_OF_YEAR:
                return ValueRange.of(1, getMaximumDayOfYear());
            case ALIGNED_WEEK_OF_MONTH:
                return ValueRange.of(1, 5);
            case YEAR:
            case YEAR_OF_ERA:
                return ValueRange.of(getMinimumYear(), getMaximumYear());
            case ERA:
                return ValueRange.of(1, 1);
            default:
                return field.range();
        }
    }
    return field.range();
}
 
Example 4
Source File: HijrahChronology.java    From desugar_jdk_libs with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    checkCalendarInit();
    if (field instanceof ChronoField) {
        ChronoField f = field;
        switch (f) {
            case DAY_OF_MONTH:
                return ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
            case DAY_OF_YEAR:
                return ValueRange.of(1, getMaximumDayOfYear());
            case ALIGNED_WEEK_OF_MONTH:
                return ValueRange.of(1, 5);
            case YEAR:
            case YEAR_OF_ERA:
                return ValueRange.of(getMinimumYear(), getMaximumYear());
            case ERA:
                return ValueRange.of(1, 1);
            default:
                return field.range();
        }
    }
    return field.range();
}
 
Example 5
Source File: HijrahChronology.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    checkCalendarInit();
    if (field instanceof ChronoField) {
        ChronoField f = field;
        switch (f) {
            case DAY_OF_MONTH:
                return ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
            case DAY_OF_YEAR:
                return ValueRange.of(1, getMaximumDayOfYear());
            case ALIGNED_WEEK_OF_MONTH:
                return ValueRange.of(1, 5);
            case YEAR:
            case YEAR_OF_ERA:
                return ValueRange.of(getMinimumYear(), getMaximumYear());
            case ERA:
                return ValueRange.of(1, 1);
            default:
                return field.range();
        }
    }
    return field.range();
}
 
Example 6
Source File: HijrahChronology.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    checkCalendarInit();
    if (field instanceof ChronoField) {
        ChronoField f = field;
        switch (f) {
            case DAY_OF_MONTH:
                return ValueRange.of(1, 1, getMinimumMonthLength(), getMaximumMonthLength());
            case DAY_OF_YEAR:
                return ValueRange.of(1, getMaximumDayOfYear());
            case ALIGNED_WEEK_OF_MONTH:
                return ValueRange.of(1, 5);
            case YEAR:
            case YEAR_OF_ERA:
                return ValueRange.of(getMinimumYear(), getMaximumYear());
            case ERA:
                return ValueRange.of(1, 1);
            default:
                return field.range();
        }
    }
    return field.range();
}
 
Example 7
Source File: CopticChronology.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    switch (field) {
        case DAY_OF_MONTH: return ValueRange.of(1, 5, 30);
        case ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, 1, 5);
        case MONTH_OF_YEAR: return ValueRange.of(1, 13);
        case PROLEPTIC_MONTH: return ValueRange.of(-1000, 1000);  // TODO
        case YEAR_OF_ERA: return ValueRange.of(1, 999, 1000);  // TODO
        case YEAR: return ValueRange.of(-1000, 1000);  // TODO
    }
    return field.range();
}
 
Example 8
Source File: CopticChronology.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    switch (field) {
        case DAY_OF_MONTH: return ValueRange.of(1, 5, 30);
        case ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, 1, 5);
        case MONTH_OF_YEAR: return ValueRange.of(1, 13);
        case PROLEPTIC_MONTH: return ValueRange.of(-1000, 1000);  // TODO
        case YEAR_OF_ERA: return ValueRange.of(1, 999, 1000);  // TODO
        case YEAR: return ValueRange.of(-1000, 1000);  // TODO
    }
    return field.range();
}
 
Example 9
Source File: CopticChronology.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    switch (field) {
        case DAY_OF_MONTH: return ValueRange.of(1, 5, 30);
        case ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, 1, 5);
        case MONTH_OF_YEAR: return ValueRange.of(1, 13);
        case PROLEPTIC_MONTH: return ValueRange.of(-1000, 1000);  // TODO
        case YEAR_OF_ERA: return ValueRange.of(1, 999, 1000);  // TODO
        case YEAR: return ValueRange.of(-1000, 1000);  // TODO
    }
    return field.range();
}
 
Example 10
Source File: CopticChronology.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    switch (field) {
        case DAY_OF_MONTH: return ValueRange.of(1, 5, 30);
        case ALIGNED_WEEK_OF_MONTH: return ValueRange.of(1, 1, 5);
        case MONTH_OF_YEAR: return ValueRange.of(1, 13);
        case PROLEPTIC_MONTH: return ValueRange.of(-1000, 1000);  // TODO
        case YEAR_OF_ERA: return ValueRange.of(1, 999, 1000);  // TODO
        case YEAR: return ValueRange.of(-1000, 1000);  // TODO
    }
    return field.range();
}
 
Example 11
Source File: IsoChronology.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 12
Source File: IsoChronology.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 13
Source File: IsoChronology.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 14
Source File: IsoChronology.java    From desugar_jdk_libs with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 15
Source File: IsoChronology.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 16
Source File: IsoChronology.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 17
Source File: IsoChronology.java    From Java8CN with Apache License 2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 18
Source File: IsoChronology.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 19
Source File: IsoChronology.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}
 
Example 20
Source File: IsoChronology.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@Override
public ValueRange range(ChronoField field) {
    return field.range();
}