<commit_before>/*
 * -----------------------------------------------------------------------
 * Copyright © 2013-2014 <NAME>, <http://www.menodata.de/>
 * -----------------------------------------------------------------------
 * This file (Iso8601Format.java) is part of project Time4J.
 *
 * Time4J is free software: You can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * Time4J is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Time4J. If not, see <http://www.gnu.org/licenses/>.
 * -----------------------------------------------------------------------
 */

package net.time4j;

import net.time4j.engine.ChronoCondition;
import net.time4j.engine.ChronoElement;
import net.time4j.engine.ChronoEntity;
import net.time4j.engine.ChronoValues;
import net.time4j.format.ChronoFormatter;
import net.time4j.format.DisplayMode;
import net.time4j.format.SignPolicy;

import java.util.Collections;
import java.util.Locale;

import static net.time4j.PlainDate.DAY_OF_MONTH;
import static net.time4j.PlainDate.DAY_OF_WEEK;
import static net.time4j.PlainDate.DAY_OF_YEAR;
import static net.time4j.PlainDate.MONTH_AS_NUMBER;
import static net.time4j.PlainDate.YEAR;
import static net.time4j.PlainDate.YEAR_OF_WEEKDATE;
import static net.time4j.PlainTime.ISO_HOUR;
import static net.time4j.PlainTime.MINUTE_OF_HOUR;
import static net.time4j.PlainTime.NANO_OF_SECOND;
import static net.time4j.PlainTime.SECOND_OF_MINUTE;


/**
 * <p>Collection of predefined format objects for ISO-8601. </p>
 *
 * @author  <NAME>
 */
/*[deutsch]
 * <p>Sammlung von vordefinierten Format-Objekten f&uuml;r ISO-8601. </p>
 *
 * @author  <NAME>
 */
public class Iso8601Format {

    //~ Statische Felder/Initialisierungen --------------------------------

    private static final NonZeroCondition NON_ZERO_SECOND =
        new NonZeroCondition(PlainTime.SECOND_OF_MINUTE);
    private static final NonZeroCondition NON_ZERO_FRACTION =
        new NonZeroCondition(PlainTime.NANO_OF_SECOND);
    private static final ChronoCondition<ChronoValues> SECOND_PART =
        NON_ZERO_SECOND.or(NON_ZERO_FRACTION);

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format with year, month and day
     * of month using the pattern &quot;uuuuMMdd&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format mit Jahr, Monat und
     * Tag des Monats im Muster &quot;uuuuMMdd&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> BASIC_CALENDAR_DATE;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format with year, month and
     * day of month using the pattern &quot;uuuu-MM-dd&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format mit Jahr, Monat und
     * Tag des Monats im Muster &quot;uuuu-MM-dd&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> EXTENDED_CALENDAR_DATE;

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format with year and day of year
     * using the pattern &quot;uuuuDDD&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format mit Jahr und
     * Tag des Jahres im Muster &quot;uuuuDDD&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> BASIC_ORDINAL_DATE;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format with year and day
     * of year using the pattern &quot;uuuu-DDD&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format mit Jahr und
     * Tag des Jahres im Muster &quot;uuuu-DDD&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> EXTENDED_ORDINAL_DATE;

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format for a week date using
     * the pattern &quot;YYYYWwwE&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format f&uuml;r ein
     * Wochendatum im Muster &quot;YYYYWwwE&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> BASIC_WEEK_DATE;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format for a week date
     * using the pattern &quot;YYYY-Www-E&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format f&uuml;r ein
     * Wochendatum im Muster &quot;YYYY-Www-E&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> EXTENDED_WEEK_DATE;

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format for a wall time with
     * hour and minute using the pattern &quot;HHmm&quot;. </p>
     *
     * <p>More elements like second and nanosecond are optional. Furthermore,
     * the count of decimal digits is flexible (0-9). </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format f&uuml;r eine
     * Uhrzeit mit Stunde und Minute im Muster &quot;HHmm&quot;. </p>
     *
     * <p>Die weiteren Elemente wie Sekunde und Nanosekunde sind optional.
     * Auch die Anzahl der Dezimalstellen ist variabel (0-9). </p>
     */
    public static final ChronoFormatter<PlainTime> BASIC_WALL_TIME;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format for a wall time
     * with hour and minute using the pattern &quot;HH:mm&quot;. </p>
     *
     * <p>More elements like second and nanosecond are optional. Furthermore,
     * the count of decimal digits is flexible (0-9). </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format f&uuml;r eine
     * Uhrzeit mit Stunde und Minute im Muster &quot;HH:mm&quot;. </p>
     *
     * <p>Die weiteren Elemente wie Sekunde und Nanosekunde sind optional.
     * Auch die Anzahl der Dezimalstellen ist variabel (0-9). </p>
     */<commit_msg>javadoc clarification<commit_after>/*
 * -----------------------------------------------------------------------
 * Copyright © 2013-2014 <NAME>, <http://www.menodata.de/>
 * -----------------------------------------------------------------------
 * This file (Iso8601Format.java) is part of project Time4J.
 *
 * Time4J is free software: You can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * Time4J is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Time4J. If not, see <http://www.gnu.org/licenses/>.
 * -----------------------------------------------------------------------
 */

package net.time4j;

import net.time4j.engine.ChronoCondition;
import net.time4j.engine.ChronoElement;
import net.time4j.engine.ChronoEntity;
import net.time4j.engine.ChronoValues;
import net.time4j.format.ChronoFormatter;
import net.time4j.format.DisplayMode;
import net.time4j.format.SignPolicy;

import java.util.Collections;
import java.util.Locale;

import static net.time4j.PlainDate.DAY_OF_MONTH;
import static net.time4j.PlainDate.DAY_OF_WEEK;
import static net.time4j.PlainDate.DAY_OF_YEAR;
import static net.time4j.PlainDate.MONTH_AS_NUMBER;
import static net.time4j.PlainDate.YEAR;
import static net.time4j.PlainDate.YEAR_OF_WEEKDATE;
import static net.time4j.PlainTime.ISO_HOUR;
import static net.time4j.PlainTime.MINUTE_OF_HOUR;
import static net.time4j.PlainTime.NANO_OF_SECOND;
import static net.time4j.PlainTime.SECOND_OF_MINUTE;


/**
 * <p>Collection of predefined format objects for ISO-8601. </p>
 *
 * @author  <NAME>
 */
/*[deutsch]
 * <p>Sammlung von vordefinierten Format-Objekten f&uuml;r ISO-8601. </p>
 *
 * @author  <NAME>
 */
public class Iso8601Format {

    //~ Statische Felder/Initialisierungen --------------------------------

    private static final NonZeroCondition NON_ZERO_SECOND =
        new NonZeroCondition(PlainTime.SECOND_OF_MINUTE);
    private static final NonZeroCondition NON_ZERO_FRACTION =
        new NonZeroCondition(PlainTime.NANO_OF_SECOND);
    private static final ChronoCondition<ChronoValues> SECOND_PART =
        NON_ZERO_SECOND.or(NON_ZERO_FRACTION);

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format with year, month and day
     * of month using the pattern &quot;uuuuMMdd&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format mit Jahr, Monat und
     * Tag des Monats im Muster &quot;uuuuMMdd&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> BASIC_CALENDAR_DATE;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format with year, month and
     * day of month using the pattern &quot;uuuu-MM-dd&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format mit Jahr, Monat und
     * Tag des Monats im Muster &quot;uuuu-MM-dd&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> EXTENDED_CALENDAR_DATE;

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format with year and day of year
     * using the pattern &quot;uuuuDDD&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format mit Jahr und
     * Tag des Jahres im Muster &quot;uuuuDDD&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> BASIC_ORDINAL_DATE;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format with year and day
     * of year using the pattern &quot;uuuu-DDD&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format mit Jahr und
     * Tag des Jahres im Muster &quot;uuuu-DDD&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> EXTENDED_ORDINAL_DATE;

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format for a week date using
     * the pattern &quot;YYYYWwwE&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format f&uuml;r ein
     * Wochendatum im Muster &quot;YYYYWwwE&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> BASIC_WEEK_DATE;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format for a week date
     * using the pattern &quot;YYYY-Www-E&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format f&uuml;r ein
     * Wochendatum im Muster &quot;YYYY-Www-E&quot;. </p>
     */
    public static final ChronoFormatter<PlainDate> EXTENDED_WEEK_DATE;

    /**
     * <p>Defines the <i>basic</i> ISO-8601-format for a wall time with
     * hour, minute and optional second using the pattern
     * &quot;HHmm[ss[SSSSSSSSS]]&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>basic</i> ISO-8601-Format f&uuml;r eine
     * Uhrzeit mit Stunde, Minute und optionaler Sekunde im Muster
     * &quot;HHmm[ss[SSSSSSSSS]]&quot;. </p>
     */
    public static final ChronoFormatter<PlainTime> BASIC_WALL_TIME;

    /**
     * <p>Defines the <i>extended</i> ISO-8601-format for a wall time
     * with hour, minute and optional second using the pattern
     * &quot;HH:mm[:ss[,SSSSSSSSS]]&quot;. </p>
     */
    /*[deutsch]
     * <p>Definiert das <i>extended</i> ISO-8601-Format f&uuml;r eine
     * Uhrzeit mit Stunde, Minute und optionaler Sekunde im Muster
     * &quot;HH:mm[:ss[,SSSSSSSSS]]&quot;. </p>
     */
{'fraction_non_alphanumeric': 0.15824513485831343, 'fraction_numerical': 0.019801980198019802, 'mean_word_length': 2.774806701030928, 'pattern_counts': {'":': 0, '<': 173, '<?xml version=': 0, '>': 173, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5318119', 'n_tokens_mistral': 4159, 'n_tokens_neox': 4052, 'n_words': 1047}