Package javax.time.calendar.format

Examples of javax.time.calendar.format.DateTimeFormatter$ClassicFormat


        }
        return deduplicate(cal.mergeStrict().toLocalTime());
    }

    private int parseSecs(String str) {
        DateTimeFormatter f = new DateTimeFormatterBuilder()
            .appendValue(ISOChronology.hourOfDayRule())
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.minuteOfHourRule(), 2)
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.secondOfMinuteRule(), 2)
            .toFormatter();
        int pos = 0;
        if (str.startsWith("-")) {
            pos = 1;
        }
        ParsePosition pp = new ParsePosition(pos);
        Calendrical cal = f.parse(str, pp);
        if (pp.getErrorIndex() >= 0) {
            throw new IllegalArgumentException(str);
        }
        LocalTime time = cal.mergeStrict().toLocalTime();
        int secs = time.getHourOfDay() * 60 * 60 +
View Full Code Here


    private String parseOptional(String str) {
        return str.equals("-") ? null : str;
    }

    private LocalTime parseTime(String str) {
        DateTimeFormatter f = new DateTimeFormatterBuilder()
            .appendValue(ISOChronology.hourOfDayRule())
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.minuteOfHourRule(), 2)
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.secondOfMinuteRule(), 2)
            .toFormatter();
        ParsePosition pp = new ParsePosition(0);
        DateTimeParseContext cal = f.parse(str, pp);
        if (pp.getErrorIndex() >= 0) {
            throw new IllegalArgumentException(str);
        }
        return deduplicate(cal.toCalendricalMerger().merge().get(LocalTime.rule()));
    }
View Full Code Here

        }
        return deduplicate(cal.toCalendricalMerger().merge().get(LocalTime.rule()));
    }

    private int parseSecs(String str) {
        DateTimeFormatter f = new DateTimeFormatterBuilder()
            .appendValue(ISOChronology.hourOfDayRule())
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.minuteOfHourRule(), 2)
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.secondOfMinuteRule(), 2)
            .toFormatter();
        int pos = 0;
        if (str.startsWith("-")) {
            pos = 1;
        }
        ParsePosition pp = new ParsePosition(pos);
        DateTimeParseContext cal = f.parse(str, pp);
        if (pp.getErrorIndex() >= 0) {
            throw new IllegalArgumentException(str);
        }
        LocalTime time = cal.toCalendricalMerger().merge().get(LocalTime.rule());
        int secs = time.getHourOfDay() * 60 * 60 +
View Full Code Here

TOP

Related Classes of javax.time.calendar.format.DateTimeFormatter$ClassicFormat

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.