src/share/classes/java/time/format/FormatStyle.java

Print this page




  48  *    without specific prior written permission.
  49  *
  50  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  51  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  52  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  53  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  54  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  55  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  56  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  57  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  58  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  60  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61  */
  62 package java.time.format;
  63 
  64 /**
  65  * Enumeration of the style of a localized date, time or date-time formatter.
  66  * <p>
  67  * These styles are used when obtaining a date-time style from configuration.
  68  * See {@link DateTimeFormatters} and {@link DateTimeFormatterBuilder} for usage.
  69  *
  70  * <h3>Specification for implementors</h3>
  71  * This is an immutable and thread-safe enum.
  72  *
  73  * @since 1.8
  74  */
  75 public enum FormatStyle {
  76     // ordered from large to small
  77 
  78     /**
  79      * Full text style, with the most detail.
  80      * For example, the format might be 'Tuesday, April 12, 1952 AD' or '3:30:42pm PST'.
  81      */
  82     FULL,
  83     /**
  84      * Long text style, with lots of detail.
  85      * For example, the format might be 'January 12, 1952'.
  86      */
  87     LONG,
  88     /**


  48  *    without specific prior written permission.
  49  *
  50  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  51  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  52  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  53  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  54  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  55  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  56  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  57  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  58  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  60  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  61  */
  62 package java.time.format;
  63 
  64 /**
  65  * Enumeration of the style of a localized date, time or date-time formatter.
  66  * <p>
  67  * These styles are used when obtaining a date-time style from configuration.
  68  * See {@link DateTimeFormatter} and {@link DateTimeFormatterBuilder} for usage.
  69  *
  70  * <h3>Specification for implementors</h3>
  71  * This is an immutable and thread-safe enum.
  72  *
  73  * @since 1.8
  74  */
  75 public enum FormatStyle {
  76     // ordered from large to small
  77 
  78     /**
  79      * Full text style, with the most detail.
  80      * For example, the format might be 'Tuesday, April 12, 1952 AD' or '3:30:42pm PST'.
  81      */
  82     FULL,
  83     /**
  84      * Long text style, with lots of detail.
  85      * For example, the format might be 'January 12, 1952'.
  86      */
  87     LONG,
  88     /**