Package javax.time.calendar

Examples of javax.time.calendar.Calendrical


     * @throws CalendricalFormatException if an error occurs during printing
     */
    public void print(CalendricalProvider calendricalProvider, Appendable appendable) {
        FormatUtil.checkNotNull(calendricalProvider, "calendrical provider");
        FormatUtil.checkNotNull(appendable, "appendable");
        Calendrical calendrical = calendricalProvider.toCalendrical();
        try {
            printerParser.print(calendrical, appendable, symbols);
        } catch (UnsupportedCalendarFieldException ex) {
            throw new CalendricalFormatFieldException(ex);
        } catch (IOException ex) {
View Full Code Here


     * @throws IndexOutOfBoundsException if the position is invalid
     * @throws CalendricalParseException if the parse fails
     */
    public Calendrical parse(String text) {
        ParsePosition pos = new ParsePosition(0);
        Calendrical result = parse(text, pos);
        if (pos.getErrorIndex() >= 0 || pos.getIndex() < text.length()) {
            String str = text;
            if (str.length() > 64) {
                str = str.substring(0, 64) + "...";
            }
View Full Code Here

        @Override
        public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
            FormatUtil.checkNotNull(obj, "object to be printed");
            FormatUtil.checkNotNull(toAppendTo, "string buffer");
            FormatUtil.checkNotNull(pos, "field position");
            Calendrical fdt = null;
            if (obj instanceof CalendricalProvider) {
                fdt = ((CalendricalProvider) obj).toCalendrical();
                if (fdt == null) {
                    throw new NullPointerException("The CalendricalProvider implementation must not return null");
                }
View Full Code Here

     * Converts this field to a <code>Calendrical</code>.
     *
     * @return the calendrical representation for this instance, never null
     */
    public Calendrical toCalendrical() {
        return new Calendrical(rule(), getValue());
    }
View Full Code Here

            .appendValue(ISOChronology.hourOfDayRule())
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.minuteOfHourRule(), 2)
            .optionalStart().appendLiteral(':').appendValue(ISOChronology.secondOfMinuteRule(), 2)
            .toFormatter();
        ParsePosition pp = new ParsePosition(0);
        Calendrical cal = f.parse(str, pp);
        if (pp.getErrorIndex() >= 0) {
            throw new IllegalArgumentException(str);
        }
        return deduplicate(cal.mergeStrict().toLocalTime());
    }
View Full Code Here

        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 +
                time.getMinuteOfHour() * 60 + time.getSecondOfMinute();
        if (pos == 1) {
            secs = -secs;
        }
View Full Code Here

     * Converts this field to a <code>Calendrical</code>.
     *
     * @return the calendrical representation for this instance, never null
     */
    public Calendrical toCalendrical() {
        return new Calendrical(rule(), getValue());
    }
View Full Code Here

     * Converts this field to a <code>Calendrical</code>.
     *
     * @return the calendrical representation for this instance, never null
     */
    public Calendrical toCalendrical() {
        return new Calendrical(rule(), getValue());
    }
View Full Code Here

     */
    public DateTimeParseContext(DateTimeFormatSymbols symbols) {
        super();
        FormatUtil.checkNotNull(symbols, "symbols");
        this.symbols = symbols;
        calendricals.add(new Calendrical());
    }
View Full Code Here

     * Converts this field to a <code>Calendrical</code>.
     *
     * @return the calendrical representation for this instance, never null
     */
    public Calendrical toCalendrical() {
        return new Calendrical(rule(), getValue());
    }
View Full Code Here

TOP

Related Classes of javax.time.calendar.Calendrical

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.