001    package edu.nrao.sss.util;
002    
003    /**
004     * A collection of strings for use with {@link java.text.Format} and its
005     * subclasses.
006     * <p>
007     * <b>Version Info:</b>
008     * <table style="margin-left:2em">
009     *   <tr><td>$Revision: 1308 $</td></tr>
010     *   <tr><td>$Date: 2008-05-23 14:12:31 -0600 (Fri, 23 May 2008) $</td></tr>
011     *   <tr><td>$Author: dharland $</td></tr>
012     * </table></p>
013     *
014     * @author David M. Harland
015     * @since 2006-05-05
016     */
017    public class FormatString
018    {
019      private FormatString()  { }
020    
021      /**
022       * An ISO 8601 standard representation of a calendar date.
023       * Format for use with {@link java.text.SimpleDateFormat}:
024       * <tt>yyyy-MM-dd</tt>.
025       * <p>
026       * See <a href="http://en.wikipedia.org/wiki/ISO_8601#Calendar_date">
027       * Wikipedia</a> for more information.
028       */
029      public static final String ISO8601_CALENDAR_DATE = "yyyy-MM-dd";
030    
031      /**
032       * An ISO 8601 standard representation of a time of day.
033       * Format for use with {@link java.text.SimpleDateFormat}:
034       * <tt>HH:mm:ss</tt>.
035       * <p>
036       * See <a href="http://en.wikipedia.org/wiki/ISO_8601#Times">
037       * Wikipedia</a> for more information.
038       */
039      public static final String ISO8601_HOUR_MIN_SEC = "HH:mm:ss";
040    
041      /**
042       * An ISO 8601 standard representation of a time of day.
043       * Format for use with {@link java.text.SimpleDateFormat}:
044       * <tt>HH:mm:ss.SSS</tt>.
045       * <p>
046       * See <a href="http://en.wikipedia.org/wiki/ISO_8601#Times">
047       * Wikipedia</a> for more information.
048       */
049      public static final String ISO8601_HOUR_MIN_SEC_MILLI = ISO8601_HOUR_MIN_SEC + ".SSS";
050      
051      /**
052       * Text used to separate the time from the date in an ISO 8601
053       * date / time string.
054       * Format for use with {@link java.text.SimpleDateFormat}:
055       * <tt>'T'</tt>.
056       * <p>
057       * See <a href="http://en.wikipedia.org/wiki/ISO_8601#Combined_representations">
058       * Wikipedia</a> for more information.
059       */
060      public static final String ISO8601_DATE_TIME_SEPARATOR = "'T'";
061    
062      /**
063       * An ISO 8601 standard representation of a timestamp.
064       * Format for use with {@link java.text.SimpleDateFormat}:
065       * <tt>yyyy-MM-dd'T'HH:mm:ss.SSS</tt>.
066       * <p>
067       * See <a href="http://en.wikipedia.org/wiki/ISO_8601#Combined_representations">
068       * Wikipedia</a> for more information.
069       */
070      public static final String ISO8601_DATE_TIME = ISO8601_CALENDAR_DATE +
071                                                     ISO8601_DATE_TIME_SEPARATOR +
072                                                     ISO8601_HOUR_MIN_SEC_MILLI;
073    
074      /**
075       * An ISO 8601 standard representation of a timestamp with timezone
076       * information.
077       * Format for use with {@link java.text.SimpleDateFormat}:
078       * <tt>yyyy-MM-dd'T'HH:mm:ss.SSSZ</tt>.
079       * <p>
080       * See <a href="http://en.wikipedia.org/wiki/ISO_8601#Combined_representations">
081       * Wikipedia</a> for more information.
082       */
083      public static final String ISO8601_DATE_TIME_TIMEZONE = ISO8601_DATE_TIME + 'Z';
084      
085      /**
086       * An ISO 8601 standard for separating endpoints of a time interval.
087       * <p>
088       * See <a href="http://en.wikipedia.org/wiki/ISO_8601#Time_interval">
089       * Wikipedia</a> for more information.
090       */
091      public static final String ISO8601_TIME_INTERVAL_SEPARATOR = "/";
092      
093      /**
094       * Text used for separating two ends of a range.
095       * This text is " - ".
096       */
097      public static final String ENDPOINT_SEPARATOR = " - ";
098    }