commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r883363 [9/48] - in /websites/production/commons/content/proper/commons-lang: ./ apidocs/ apidocs/org/apache/commons/lang3/ apidocs/org/apache/commons/lang3/builder/ apidocs/org/apache/commons/lang3/builder/class-use/ apidocs/org/apache/com...
Date Sat, 19 Oct 2013 17:17:59 GMT
Modified: websites/production/commons/content/proper/commons-lang/apidocs/src-html/org/apache/commons/lang3/time/FastDatePrinter.html
==============================================================================
--- websites/production/commons/content/proper/commons-lang/apidocs/src-html/org/apache/commons/lang3/time/FastDatePrinter.html (original)
+++ websites/production/commons/content/proper/commons-lang/apidocs/src-html/org/apache/commons/lang3/time/FastDatePrinter.html Sat Oct 19 17:17:55 2013
@@ -402,866 +402,875 @@
 <FONT color="green">399</FONT>            return applyRulesToString(c);<a name="line.399"></a>
 <FONT color="green">400</FONT>        }<a name="line.400"></a>
 <FONT color="green">401</FONT>    <a name="line.401"></a>
-<FONT color="green">402</FONT>        private String applyRulesToString(final Calendar c) {<a name="line.402"></a>
-<FONT color="green">403</FONT>            return applyRules(c, new StringBuffer(mMaxLengthEstimate)).toString();<a name="line.403"></a>
-<FONT color="green">404</FONT>        }<a name="line.404"></a>
-<FONT color="green">405</FONT>    <a name="line.405"></a>
-<FONT color="green">406</FONT>        private GregorianCalendar newCalendar() {<a name="line.406"></a>
-<FONT color="green">407</FONT>            // hard code GregorianCalendar<a name="line.407"></a>
-<FONT color="green">408</FONT>            return new GregorianCalendar(mTimeZone, mLocale);<a name="line.408"></a>
+<FONT color="green">402</FONT>        /**<a name="line.402"></a>
+<FONT color="green">403</FONT>         * Creates a String representation of the given Calendar by applying the rules of this printer to it.<a name="line.403"></a>
+<FONT color="green">404</FONT>         * @param c the Calender to apply the rules to.<a name="line.404"></a>
+<FONT color="green">405</FONT>         * @return a String representation of the given Calendar.<a name="line.405"></a>
+<FONT color="green">406</FONT>         */<a name="line.406"></a>
+<FONT color="green">407</FONT>        private String applyRulesToString(final Calendar c) {<a name="line.407"></a>
+<FONT color="green">408</FONT>            return applyRules(c, new StringBuffer(mMaxLengthEstimate)).toString();<a name="line.408"></a>
 <FONT color="green">409</FONT>        }<a name="line.409"></a>
 <FONT color="green">410</FONT>    <a name="line.410"></a>
-<FONT color="green">411</FONT>        /* (non-Javadoc)<a name="line.411"></a>
-<FONT color="green">412</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date)<a name="line.412"></a>
-<FONT color="green">413</FONT>         */<a name="line.413"></a>
-<FONT color="green">414</FONT>        @Override<a name="line.414"></a>
-<FONT color="green">415</FONT>        public String format(final Date date) {<a name="line.415"></a>
-<FONT color="green">416</FONT>            final Calendar c = newCalendar();  // hard code GregorianCalendar<a name="line.416"></a>
-<FONT color="green">417</FONT>            c.setTime(date);<a name="line.417"></a>
-<FONT color="green">418</FONT>            return applyRulesToString(c);<a name="line.418"></a>
-<FONT color="green">419</FONT>        }<a name="line.419"></a>
-<FONT color="green">420</FONT>    <a name="line.420"></a>
-<FONT color="green">421</FONT>        /* (non-Javadoc)<a name="line.421"></a>
-<FONT color="green">422</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar)<a name="line.422"></a>
-<FONT color="green">423</FONT>         */<a name="line.423"></a>
-<FONT color="green">424</FONT>        @Override<a name="line.424"></a>
-<FONT color="green">425</FONT>        public String format(final Calendar calendar) {<a name="line.425"></a>
-<FONT color="green">426</FONT>            return format(calendar, new StringBuffer(mMaxLengthEstimate)).toString();<a name="line.426"></a>
-<FONT color="green">427</FONT>        }<a name="line.427"></a>
-<FONT color="green">428</FONT>    <a name="line.428"></a>
-<FONT color="green">429</FONT>        /* (non-Javadoc)<a name="line.429"></a>
-<FONT color="green">430</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(long, java.lang.StringBuffer)<a name="line.430"></a>
-<FONT color="green">431</FONT>         */<a name="line.431"></a>
-<FONT color="green">432</FONT>        @Override<a name="line.432"></a>
-<FONT color="green">433</FONT>        public StringBuffer format(final long millis, final StringBuffer buf) {<a name="line.433"></a>
-<FONT color="green">434</FONT>            return format(new Date(millis), buf);<a name="line.434"></a>
-<FONT color="green">435</FONT>        }<a name="line.435"></a>
-<FONT color="green">436</FONT>    <a name="line.436"></a>
-<FONT color="green">437</FONT>        /* (non-Javadoc)<a name="line.437"></a>
-<FONT color="green">438</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date, java.lang.StringBuffer)<a name="line.438"></a>
-<FONT color="green">439</FONT>         */<a name="line.439"></a>
-<FONT color="green">440</FONT>        @Override<a name="line.440"></a>
-<FONT color="green">441</FONT>        public StringBuffer format(final Date date, final StringBuffer buf) {<a name="line.441"></a>
-<FONT color="green">442</FONT>            final Calendar c = newCalendar();  // hard code GregorianCalendar<a name="line.442"></a>
-<FONT color="green">443</FONT>            c.setTime(date);<a name="line.443"></a>
-<FONT color="green">444</FONT>            return applyRules(c, buf);<a name="line.444"></a>
-<FONT color="green">445</FONT>        }<a name="line.445"></a>
-<FONT color="green">446</FONT>    <a name="line.446"></a>
-<FONT color="green">447</FONT>        /* (non-Javadoc)<a name="line.447"></a>
-<FONT color="green">448</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar, java.lang.StringBuffer)<a name="line.448"></a>
-<FONT color="green">449</FONT>         */<a name="line.449"></a>
-<FONT color="green">450</FONT>        @Override<a name="line.450"></a>
-<FONT color="green">451</FONT>        public StringBuffer format(final Calendar calendar, final StringBuffer buf) {<a name="line.451"></a>
-<FONT color="green">452</FONT>            return applyRules(calendar, buf);<a name="line.452"></a>
-<FONT color="green">453</FONT>        }<a name="line.453"></a>
-<FONT color="green">454</FONT>    <a name="line.454"></a>
-<FONT color="green">455</FONT>        /**<a name="line.455"></a>
-<FONT color="green">456</FONT>         * &lt;p&gt;Performs the formatting by applying the rules to the<a name="line.456"></a>
-<FONT color="green">457</FONT>         * specified calendar.&lt;/p&gt;<a name="line.457"></a>
-<FONT color="green">458</FONT>         *<a name="line.458"></a>
-<FONT color="green">459</FONT>         * @param calendar  the calendar to format<a name="line.459"></a>
-<FONT color="green">460</FONT>         * @param buf  the buffer to format into<a name="line.460"></a>
-<FONT color="green">461</FONT>         * @return the specified string buffer<a name="line.461"></a>
-<FONT color="green">462</FONT>         */<a name="line.462"></a>
-<FONT color="green">463</FONT>        protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) {<a name="line.463"></a>
-<FONT color="green">464</FONT>            for (final Rule rule : mRules) {<a name="line.464"></a>
-<FONT color="green">465</FONT>                rule.appendTo(buf, calendar);<a name="line.465"></a>
-<FONT color="green">466</FONT>            }<a name="line.466"></a>
-<FONT color="green">467</FONT>            return buf;<a name="line.467"></a>
-<FONT color="green">468</FONT>        }<a name="line.468"></a>
-<FONT color="green">469</FONT>    <a name="line.469"></a>
-<FONT color="green">470</FONT>        // Accessors<a name="line.470"></a>
-<FONT color="green">471</FONT>        //-----------------------------------------------------------------------<a name="line.471"></a>
-<FONT color="green">472</FONT>        /* (non-Javadoc)<a name="line.472"></a>
-<FONT color="green">473</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#getPattern()<a name="line.473"></a>
-<FONT color="green">474</FONT>         */<a name="line.474"></a>
-<FONT color="green">475</FONT>        @Override<a name="line.475"></a>
-<FONT color="green">476</FONT>        public String getPattern() {<a name="line.476"></a>
-<FONT color="green">477</FONT>            return mPattern;<a name="line.477"></a>
-<FONT color="green">478</FONT>        }<a name="line.478"></a>
-<FONT color="green">479</FONT>    <a name="line.479"></a>
-<FONT color="green">480</FONT>        /* (non-Javadoc)<a name="line.480"></a>
-<FONT color="green">481</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#getTimeZone()<a name="line.481"></a>
-<FONT color="green">482</FONT>         */<a name="line.482"></a>
-<FONT color="green">483</FONT>        @Override<a name="line.483"></a>
-<FONT color="green">484</FONT>        public TimeZone getTimeZone() {<a name="line.484"></a>
-<FONT color="green">485</FONT>            return mTimeZone;<a name="line.485"></a>
-<FONT color="green">486</FONT>        }<a name="line.486"></a>
-<FONT color="green">487</FONT>    <a name="line.487"></a>
-<FONT color="green">488</FONT>        /* (non-Javadoc)<a name="line.488"></a>
-<FONT color="green">489</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#getLocale()<a name="line.489"></a>
-<FONT color="green">490</FONT>         */<a name="line.490"></a>
-<FONT color="green">491</FONT>        @Override<a name="line.491"></a>
-<FONT color="green">492</FONT>        public Locale getLocale() {<a name="line.492"></a>
-<FONT color="green">493</FONT>            return mLocale;<a name="line.493"></a>
-<FONT color="green">494</FONT>        }<a name="line.494"></a>
-<FONT color="green">495</FONT>    <a name="line.495"></a>
-<FONT color="green">496</FONT>        /**<a name="line.496"></a>
-<FONT color="green">497</FONT>         * &lt;p&gt;Gets an estimate for the maximum string length that the<a name="line.497"></a>
-<FONT color="green">498</FONT>         * formatter will produce.&lt;/p&gt;<a name="line.498"></a>
-<FONT color="green">499</FONT>         *<a name="line.499"></a>
-<FONT color="green">500</FONT>         * &lt;p&gt;The actual formatted length will almost always be less than or<a name="line.500"></a>
-<FONT color="green">501</FONT>         * equal to this amount.&lt;/p&gt;<a name="line.501"></a>
-<FONT color="green">502</FONT>         *<a name="line.502"></a>
-<FONT color="green">503</FONT>         * @return the maximum formatted length<a name="line.503"></a>
-<FONT color="green">504</FONT>         */<a name="line.504"></a>
-<FONT color="green">505</FONT>        public int getMaxLengthEstimate() {<a name="line.505"></a>
-<FONT color="green">506</FONT>            return mMaxLengthEstimate;<a name="line.506"></a>
-<FONT color="green">507</FONT>        }<a name="line.507"></a>
-<FONT color="green">508</FONT>    <a name="line.508"></a>
-<FONT color="green">509</FONT>        // Basics<a name="line.509"></a>
-<FONT color="green">510</FONT>        //-----------------------------------------------------------------------<a name="line.510"></a>
-<FONT color="green">511</FONT>        /**<a name="line.511"></a>
-<FONT color="green">512</FONT>         * &lt;p&gt;Compares two objects for equality.&lt;/p&gt;<a name="line.512"></a>
-<FONT color="green">513</FONT>         *<a name="line.513"></a>
-<FONT color="green">514</FONT>         * @param obj  the object to compare to<a name="line.514"></a>
-<FONT color="green">515</FONT>         * @return {@code true} if equal<a name="line.515"></a>
-<FONT color="green">516</FONT>         */<a name="line.516"></a>
-<FONT color="green">517</FONT>        @Override<a name="line.517"></a>
-<FONT color="green">518</FONT>        public boolean equals(final Object obj) {<a name="line.518"></a>
-<FONT color="green">519</FONT>            if (obj instanceof FastDatePrinter == false) {<a name="line.519"></a>
-<FONT color="green">520</FONT>                return false;<a name="line.520"></a>
-<FONT color="green">521</FONT>            }<a name="line.521"></a>
-<FONT color="green">522</FONT>            final FastDatePrinter other = (FastDatePrinter) obj;<a name="line.522"></a>
-<FONT color="green">523</FONT>            return mPattern.equals(other.mPattern)<a name="line.523"></a>
-<FONT color="green">524</FONT>                &amp;&amp; mTimeZone.equals(other.mTimeZone) <a name="line.524"></a>
-<FONT color="green">525</FONT>                &amp;&amp; mLocale.equals(other.mLocale);<a name="line.525"></a>
-<FONT color="green">526</FONT>        }<a name="line.526"></a>
-<FONT color="green">527</FONT>    <a name="line.527"></a>
-<FONT color="green">528</FONT>        /**<a name="line.528"></a>
-<FONT color="green">529</FONT>         * &lt;p&gt;Returns a hashcode compatible with equals.&lt;/p&gt;<a name="line.529"></a>
-<FONT color="green">530</FONT>         *<a name="line.530"></a>
-<FONT color="green">531</FONT>         * @return a hashcode compatible with equals<a name="line.531"></a>
-<FONT color="green">532</FONT>         */<a name="line.532"></a>
-<FONT color="green">533</FONT>        @Override<a name="line.533"></a>
-<FONT color="green">534</FONT>        public int hashCode() {<a name="line.534"></a>
-<FONT color="green">535</FONT>            return mPattern.hashCode() + 13 * (mTimeZone.hashCode() + 13 * mLocale.hashCode());<a name="line.535"></a>
-<FONT color="green">536</FONT>        }<a name="line.536"></a>
-<FONT color="green">537</FONT>    <a name="line.537"></a>
-<FONT color="green">538</FONT>        /**<a name="line.538"></a>
-<FONT color="green">539</FONT>         * &lt;p&gt;Gets a debugging string version of this formatter.&lt;/p&gt;<a name="line.539"></a>
-<FONT color="green">540</FONT>         *<a name="line.540"></a>
-<FONT color="green">541</FONT>         * @return a debugging string<a name="line.541"></a>
-<FONT color="green">542</FONT>         */<a name="line.542"></a>
-<FONT color="green">543</FONT>        @Override<a name="line.543"></a>
-<FONT color="green">544</FONT>        public String toString() {<a name="line.544"></a>
-<FONT color="green">545</FONT>            return "FastDatePrinter[" + mPattern + "," + mLocale + "," + mTimeZone.getID() + "]";<a name="line.545"></a>
-<FONT color="green">546</FONT>        }<a name="line.546"></a>
-<FONT color="green">547</FONT>    <a name="line.547"></a>
-<FONT color="green">548</FONT>        // Serializing<a name="line.548"></a>
-<FONT color="green">549</FONT>        //-----------------------------------------------------------------------<a name="line.549"></a>
-<FONT color="green">550</FONT>        /**<a name="line.550"></a>
-<FONT color="green">551</FONT>         * Create the object after serialization. This implementation reinitializes the<a name="line.551"></a>
-<FONT color="green">552</FONT>         * transient properties.<a name="line.552"></a>
-<FONT color="green">553</FONT>         *<a name="line.553"></a>
-<FONT color="green">554</FONT>         * @param in ObjectInputStream from which the object is being deserialized.<a name="line.554"></a>
-<FONT color="green">555</FONT>         * @throws IOException if there is an IO issue.<a name="line.555"></a>
-<FONT color="green">556</FONT>         * @throws ClassNotFoundException if a class cannot be found.<a name="line.556"></a>
-<FONT color="green">557</FONT>         */<a name="line.557"></a>
-<FONT color="green">558</FONT>        private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {<a name="line.558"></a>
-<FONT color="green">559</FONT>            in.defaultReadObject();<a name="line.559"></a>
-<FONT color="green">560</FONT>            init();<a name="line.560"></a>
-<FONT color="green">561</FONT>        }<a name="line.561"></a>
-<FONT color="green">562</FONT>    <a name="line.562"></a>
-<FONT color="green">563</FONT>        // Rules<a name="line.563"></a>
-<FONT color="green">564</FONT>        //-----------------------------------------------------------------------<a name="line.564"></a>
-<FONT color="green">565</FONT>        /**<a name="line.565"></a>
-<FONT color="green">566</FONT>         * &lt;p&gt;Inner class defining a rule.&lt;/p&gt;<a name="line.566"></a>
-<FONT color="green">567</FONT>         */<a name="line.567"></a>
-<FONT color="green">568</FONT>        private interface Rule {<a name="line.568"></a>
-<FONT color="green">569</FONT>            /**<a name="line.569"></a>
-<FONT color="green">570</FONT>             * Returns the estimated lentgh of the result.<a name="line.570"></a>
-<FONT color="green">571</FONT>             *<a name="line.571"></a>
-<FONT color="green">572</FONT>             * @return the estimated length<a name="line.572"></a>
-<FONT color="green">573</FONT>             */<a name="line.573"></a>
-<FONT color="green">574</FONT>            int estimateLength();<a name="line.574"></a>
-<FONT color="green">575</FONT>    <a name="line.575"></a>
-<FONT color="green">576</FONT>            /**<a name="line.576"></a>
-<FONT color="green">577</FONT>             * Appends the value of the specified calendar to the output buffer based on the rule implementation.<a name="line.577"></a>
-<FONT color="green">578</FONT>             *<a name="line.578"></a>
-<FONT color="green">579</FONT>             * @param buffer the output buffer<a name="line.579"></a>
-<FONT color="green">580</FONT>             * @param calendar calendar to be appended<a name="line.580"></a>
-<FONT color="green">581</FONT>             */<a name="line.581"></a>
-<FONT color="green">582</FONT>            void appendTo(StringBuffer buffer, Calendar calendar);<a name="line.582"></a>
-<FONT color="green">583</FONT>        }<a name="line.583"></a>
+<FONT color="green">411</FONT>        /**<a name="line.411"></a>
+<FONT color="green">412</FONT>         * Creation method for ne calender instances.<a name="line.412"></a>
+<FONT color="green">413</FONT>         * @return a new Calendar instance.<a name="line.413"></a>
+<FONT color="green">414</FONT>         */<a name="line.414"></a>
+<FONT color="green">415</FONT>        private GregorianCalendar newCalendar() {<a name="line.415"></a>
+<FONT color="green">416</FONT>            // hard code GregorianCalendar<a name="line.416"></a>
+<FONT color="green">417</FONT>            return new GregorianCalendar(mTimeZone, mLocale);<a name="line.417"></a>
+<FONT color="green">418</FONT>        }<a name="line.418"></a>
+<FONT color="green">419</FONT>    <a name="line.419"></a>
+<FONT color="green">420</FONT>        /* (non-Javadoc)<a name="line.420"></a>
+<FONT color="green">421</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date)<a name="line.421"></a>
+<FONT color="green">422</FONT>         */<a name="line.422"></a>
+<FONT color="green">423</FONT>        @Override<a name="line.423"></a>
+<FONT color="green">424</FONT>        public String format(final Date date) {<a name="line.424"></a>
+<FONT color="green">425</FONT>            final Calendar c = newCalendar();  // hard code GregorianCalendar<a name="line.425"></a>
+<FONT color="green">426</FONT>            c.setTime(date);<a name="line.426"></a>
+<FONT color="green">427</FONT>            return applyRulesToString(c);<a name="line.427"></a>
+<FONT color="green">428</FONT>        }<a name="line.428"></a>
+<FONT color="green">429</FONT>    <a name="line.429"></a>
+<FONT color="green">430</FONT>        /* (non-Javadoc)<a name="line.430"></a>
+<FONT color="green">431</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar)<a name="line.431"></a>
+<FONT color="green">432</FONT>         */<a name="line.432"></a>
+<FONT color="green">433</FONT>        @Override<a name="line.433"></a>
+<FONT color="green">434</FONT>        public String format(final Calendar calendar) {<a name="line.434"></a>
+<FONT color="green">435</FONT>            return format(calendar, new StringBuffer(mMaxLengthEstimate)).toString();<a name="line.435"></a>
+<FONT color="green">436</FONT>        }<a name="line.436"></a>
+<FONT color="green">437</FONT>    <a name="line.437"></a>
+<FONT color="green">438</FONT>        /* (non-Javadoc)<a name="line.438"></a>
+<FONT color="green">439</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(long, java.lang.StringBuffer)<a name="line.439"></a>
+<FONT color="green">440</FONT>         */<a name="line.440"></a>
+<FONT color="green">441</FONT>        @Override<a name="line.441"></a>
+<FONT color="green">442</FONT>        public StringBuffer format(final long millis, final StringBuffer buf) {<a name="line.442"></a>
+<FONT color="green">443</FONT>            return format(new Date(millis), buf);<a name="line.443"></a>
+<FONT color="green">444</FONT>        }<a name="line.444"></a>
+<FONT color="green">445</FONT>    <a name="line.445"></a>
+<FONT color="green">446</FONT>        /* (non-Javadoc)<a name="line.446"></a>
+<FONT color="green">447</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date, java.lang.StringBuffer)<a name="line.447"></a>
+<FONT color="green">448</FONT>         */<a name="line.448"></a>
+<FONT color="green">449</FONT>        @Override<a name="line.449"></a>
+<FONT color="green">450</FONT>        public StringBuffer format(final Date date, final StringBuffer buf) {<a name="line.450"></a>
+<FONT color="green">451</FONT>            final Calendar c = newCalendar();  // hard code GregorianCalendar<a name="line.451"></a>
+<FONT color="green">452</FONT>            c.setTime(date);<a name="line.452"></a>
+<FONT color="green">453</FONT>            return applyRules(c, buf);<a name="line.453"></a>
+<FONT color="green">454</FONT>        }<a name="line.454"></a>
+<FONT color="green">455</FONT>    <a name="line.455"></a>
+<FONT color="green">456</FONT>        /* (non-Javadoc)<a name="line.456"></a>
+<FONT color="green">457</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar, java.lang.StringBuffer)<a name="line.457"></a>
+<FONT color="green">458</FONT>         */<a name="line.458"></a>
+<FONT color="green">459</FONT>        @Override<a name="line.459"></a>
+<FONT color="green">460</FONT>        public StringBuffer format(final Calendar calendar, final StringBuffer buf) {<a name="line.460"></a>
+<FONT color="green">461</FONT>            return applyRules(calendar, buf);<a name="line.461"></a>
+<FONT color="green">462</FONT>        }<a name="line.462"></a>
+<FONT color="green">463</FONT>    <a name="line.463"></a>
+<FONT color="green">464</FONT>        /**<a name="line.464"></a>
+<FONT color="green">465</FONT>         * &lt;p&gt;Performs the formatting by applying the rules to the<a name="line.465"></a>
+<FONT color="green">466</FONT>         * specified calendar.&lt;/p&gt;<a name="line.466"></a>
+<FONT color="green">467</FONT>         *<a name="line.467"></a>
+<FONT color="green">468</FONT>         * @param calendar  the calendar to format<a name="line.468"></a>
+<FONT color="green">469</FONT>         * @param buf  the buffer to format into<a name="line.469"></a>
+<FONT color="green">470</FONT>         * @return the specified string buffer<a name="line.470"></a>
+<FONT color="green">471</FONT>         */<a name="line.471"></a>
+<FONT color="green">472</FONT>        protected StringBuffer applyRules(final Calendar calendar, final StringBuffer buf) {<a name="line.472"></a>
+<FONT color="green">473</FONT>            for (final Rule rule : mRules) {<a name="line.473"></a>
+<FONT color="green">474</FONT>                rule.appendTo(buf, calendar);<a name="line.474"></a>
+<FONT color="green">475</FONT>            }<a name="line.475"></a>
+<FONT color="green">476</FONT>            return buf;<a name="line.476"></a>
+<FONT color="green">477</FONT>        }<a name="line.477"></a>
+<FONT color="green">478</FONT>    <a name="line.478"></a>
+<FONT color="green">479</FONT>        // Accessors<a name="line.479"></a>
+<FONT color="green">480</FONT>        //-----------------------------------------------------------------------<a name="line.480"></a>
+<FONT color="green">481</FONT>        /* (non-Javadoc)<a name="line.481"></a>
+<FONT color="green">482</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#getPattern()<a name="line.482"></a>
+<FONT color="green">483</FONT>         */<a name="line.483"></a>
+<FONT color="green">484</FONT>        @Override<a name="line.484"></a>
+<FONT color="green">485</FONT>        public String getPattern() {<a name="line.485"></a>
+<FONT color="green">486</FONT>            return mPattern;<a name="line.486"></a>
+<FONT color="green">487</FONT>        }<a name="line.487"></a>
+<FONT color="green">488</FONT>    <a name="line.488"></a>
+<FONT color="green">489</FONT>        /* (non-Javadoc)<a name="line.489"></a>
+<FONT color="green">490</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#getTimeZone()<a name="line.490"></a>
+<FONT color="green">491</FONT>         */<a name="line.491"></a>
+<FONT color="green">492</FONT>        @Override<a name="line.492"></a>
+<FONT color="green">493</FONT>        public TimeZone getTimeZone() {<a name="line.493"></a>
+<FONT color="green">494</FONT>            return mTimeZone;<a name="line.494"></a>
+<FONT color="green">495</FONT>        }<a name="line.495"></a>
+<FONT color="green">496</FONT>    <a name="line.496"></a>
+<FONT color="green">497</FONT>        /* (non-Javadoc)<a name="line.497"></a>
+<FONT color="green">498</FONT>         * @see org.apache.commons.lang3.time.DatePrinter#getLocale()<a name="line.498"></a>
+<FONT color="green">499</FONT>         */<a name="line.499"></a>
+<FONT color="green">500</FONT>        @Override<a name="line.500"></a>
+<FONT color="green">501</FONT>        public Locale getLocale() {<a name="line.501"></a>
+<FONT color="green">502</FONT>            return mLocale;<a name="line.502"></a>
+<FONT color="green">503</FONT>        }<a name="line.503"></a>
+<FONT color="green">504</FONT>    <a name="line.504"></a>
+<FONT color="green">505</FONT>        /**<a name="line.505"></a>
+<FONT color="green">506</FONT>         * &lt;p&gt;Gets an estimate for the maximum string length that the<a name="line.506"></a>
+<FONT color="green">507</FONT>         * formatter will produce.&lt;/p&gt;<a name="line.507"></a>
+<FONT color="green">508</FONT>         *<a name="line.508"></a>
+<FONT color="green">509</FONT>         * &lt;p&gt;The actual formatted length will almost always be less than or<a name="line.509"></a>
+<FONT color="green">510</FONT>         * equal to this amount.&lt;/p&gt;<a name="line.510"></a>
+<FONT color="green">511</FONT>         *<a name="line.511"></a>
+<FONT color="green">512</FONT>         * @return the maximum formatted length<a name="line.512"></a>
+<FONT color="green">513</FONT>         */<a name="line.513"></a>
+<FONT color="green">514</FONT>        public int getMaxLengthEstimate() {<a name="line.514"></a>
+<FONT color="green">515</FONT>            return mMaxLengthEstimate;<a name="line.515"></a>
+<FONT color="green">516</FONT>        }<a name="line.516"></a>
+<FONT color="green">517</FONT>    <a name="line.517"></a>
+<FONT color="green">518</FONT>        // Basics<a name="line.518"></a>
+<FONT color="green">519</FONT>        //-----------------------------------------------------------------------<a name="line.519"></a>
+<FONT color="green">520</FONT>        /**<a name="line.520"></a>
+<FONT color="green">521</FONT>         * &lt;p&gt;Compares two objects for equality.&lt;/p&gt;<a name="line.521"></a>
+<FONT color="green">522</FONT>         *<a name="line.522"></a>
+<FONT color="green">523</FONT>         * @param obj  the object to compare to<a name="line.523"></a>
+<FONT color="green">524</FONT>         * @return {@code true} if equal<a name="line.524"></a>
+<FONT color="green">525</FONT>         */<a name="line.525"></a>
+<FONT color="green">526</FONT>        @Override<a name="line.526"></a>
+<FONT color="green">527</FONT>        public boolean equals(final Object obj) {<a name="line.527"></a>
+<FONT color="green">528</FONT>            if (obj instanceof FastDatePrinter == false) {<a name="line.528"></a>
+<FONT color="green">529</FONT>                return false;<a name="line.529"></a>
+<FONT color="green">530</FONT>            }<a name="line.530"></a>
+<FONT color="green">531</FONT>            final FastDatePrinter other = (FastDatePrinter) obj;<a name="line.531"></a>
+<FONT color="green">532</FONT>            return mPattern.equals(other.mPattern)<a name="line.532"></a>
+<FONT color="green">533</FONT>                &amp;&amp; mTimeZone.equals(other.mTimeZone) <a name="line.533"></a>
+<FONT color="green">534</FONT>                &amp;&amp; mLocale.equals(other.mLocale);<a name="line.534"></a>
+<FONT color="green">535</FONT>        }<a name="line.535"></a>
+<FONT color="green">536</FONT>    <a name="line.536"></a>
+<FONT color="green">537</FONT>        /**<a name="line.537"></a>
+<FONT color="green">538</FONT>         * &lt;p&gt;Returns a hashcode compatible with equals.&lt;/p&gt;<a name="line.538"></a>
+<FONT color="green">539</FONT>         *<a name="line.539"></a>
+<FONT color="green">540</FONT>         * @return a hashcode compatible with equals<a name="line.540"></a>
+<FONT color="green">541</FONT>         */<a name="line.541"></a>
+<FONT color="green">542</FONT>        @Override<a name="line.542"></a>
+<FONT color="green">543</FONT>        public int hashCode() {<a name="line.543"></a>
+<FONT color="green">544</FONT>            return mPattern.hashCode() + 13 * (mTimeZone.hashCode() + 13 * mLocale.hashCode());<a name="line.544"></a>
+<FONT color="green">545</FONT>        }<a name="line.545"></a>
+<FONT color="green">546</FONT>    <a name="line.546"></a>
+<FONT color="green">547</FONT>        /**<a name="line.547"></a>
+<FONT color="green">548</FONT>         * &lt;p&gt;Gets a debugging string version of this formatter.&lt;/p&gt;<a name="line.548"></a>
+<FONT color="green">549</FONT>         *<a name="line.549"></a>
+<FONT color="green">550</FONT>         * @return a debugging string<a name="line.550"></a>
+<FONT color="green">551</FONT>         */<a name="line.551"></a>
+<FONT color="green">552</FONT>        @Override<a name="line.552"></a>
+<FONT color="green">553</FONT>        public String toString() {<a name="line.553"></a>
+<FONT color="green">554</FONT>            return "FastDatePrinter[" + mPattern + "," + mLocale + "," + mTimeZone.getID() + "]";<a name="line.554"></a>
+<FONT color="green">555</FONT>        }<a name="line.555"></a>
+<FONT color="green">556</FONT>    <a name="line.556"></a>
+<FONT color="green">557</FONT>        // Serializing<a name="line.557"></a>
+<FONT color="green">558</FONT>        //-----------------------------------------------------------------------<a name="line.558"></a>
+<FONT color="green">559</FONT>        /**<a name="line.559"></a>
+<FONT color="green">560</FONT>         * Create the object after serialization. This implementation reinitializes the<a name="line.560"></a>
+<FONT color="green">561</FONT>         * transient properties.<a name="line.561"></a>
+<FONT color="green">562</FONT>         *<a name="line.562"></a>
+<FONT color="green">563</FONT>         * @param in ObjectInputStream from which the object is being deserialized.<a name="line.563"></a>
+<FONT color="green">564</FONT>         * @throws IOException if there is an IO issue.<a name="line.564"></a>
+<FONT color="green">565</FONT>         * @throws ClassNotFoundException if a class cannot be found.<a name="line.565"></a>
+<FONT color="green">566</FONT>         */<a name="line.566"></a>
+<FONT color="green">567</FONT>        private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {<a name="line.567"></a>
+<FONT color="green">568</FONT>            in.defaultReadObject();<a name="line.568"></a>
+<FONT color="green">569</FONT>            init();<a name="line.569"></a>
+<FONT color="green">570</FONT>        }<a name="line.570"></a>
+<FONT color="green">571</FONT>    <a name="line.571"></a>
+<FONT color="green">572</FONT>        // Rules<a name="line.572"></a>
+<FONT color="green">573</FONT>        //-----------------------------------------------------------------------<a name="line.573"></a>
+<FONT color="green">574</FONT>        /**<a name="line.574"></a>
+<FONT color="green">575</FONT>         * &lt;p&gt;Inner class defining a rule.&lt;/p&gt;<a name="line.575"></a>
+<FONT color="green">576</FONT>         */<a name="line.576"></a>
+<FONT color="green">577</FONT>        private interface Rule {<a name="line.577"></a>
+<FONT color="green">578</FONT>            /**<a name="line.578"></a>
+<FONT color="green">579</FONT>             * Returns the estimated lentgh of the result.<a name="line.579"></a>
+<FONT color="green">580</FONT>             *<a name="line.580"></a>
+<FONT color="green">581</FONT>             * @return the estimated length<a name="line.581"></a>
+<FONT color="green">582</FONT>             */<a name="line.582"></a>
+<FONT color="green">583</FONT>            int estimateLength();<a name="line.583"></a>
 <FONT color="green">584</FONT>    <a name="line.584"></a>
-<FONT color="green">585</FONT>        /**<a name="line.585"></a>
-<FONT color="green">586</FONT>         * &lt;p&gt;Inner class defining a numeric rule.&lt;/p&gt;<a name="line.586"></a>
-<FONT color="green">587</FONT>         */<a name="line.587"></a>
-<FONT color="green">588</FONT>        private interface NumberRule extends Rule {<a name="line.588"></a>
-<FONT color="green">589</FONT>            /**<a name="line.589"></a>
-<FONT color="green">590</FONT>             * Appends the specified value to the output buffer based on the rule implementation.<a name="line.590"></a>
-<FONT color="green">591</FONT>             *<a name="line.591"></a>
-<FONT color="green">592</FONT>             * @param buffer the output buffer<a name="line.592"></a>
-<FONT color="green">593</FONT>             * @param value the value to be appended<a name="line.593"></a>
-<FONT color="green">594</FONT>             */<a name="line.594"></a>
-<FONT color="green">595</FONT>            void appendTo(StringBuffer buffer, int value);<a name="line.595"></a>
-<FONT color="green">596</FONT>        }<a name="line.596"></a>
-<FONT color="green">597</FONT>    <a name="line.597"></a>
-<FONT color="green">598</FONT>        /**<a name="line.598"></a>
-<FONT color="green">599</FONT>         * &lt;p&gt;Inner class to output a constant single character.&lt;/p&gt;<a name="line.599"></a>
-<FONT color="green">600</FONT>         */<a name="line.600"></a>
-<FONT color="green">601</FONT>        private static class CharacterLiteral implements Rule {<a name="line.601"></a>
-<FONT color="green">602</FONT>            private final char mValue;<a name="line.602"></a>
-<FONT color="green">603</FONT>    <a name="line.603"></a>
-<FONT color="green">604</FONT>            /**<a name="line.604"></a>
-<FONT color="green">605</FONT>             * Constructs a new instance of {@code CharacterLiteral}<a name="line.605"></a>
-<FONT color="green">606</FONT>             * to hold the specified value.<a name="line.606"></a>
-<FONT color="green">607</FONT>             *<a name="line.607"></a>
-<FONT color="green">608</FONT>             * @param value the character literal<a name="line.608"></a>
-<FONT color="green">609</FONT>             */<a name="line.609"></a>
-<FONT color="green">610</FONT>            CharacterLiteral(final char value) {<a name="line.610"></a>
-<FONT color="green">611</FONT>                mValue = value;<a name="line.611"></a>
-<FONT color="green">612</FONT>            }<a name="line.612"></a>
-<FONT color="green">613</FONT>    <a name="line.613"></a>
-<FONT color="green">614</FONT>            /**<a name="line.614"></a>
-<FONT color="green">615</FONT>             * {@inheritDoc}<a name="line.615"></a>
-<FONT color="green">616</FONT>             */<a name="line.616"></a>
-<FONT color="green">617</FONT>            @Override<a name="line.617"></a>
-<FONT color="green">618</FONT>            public int estimateLength() {<a name="line.618"></a>
-<FONT color="green">619</FONT>                return 1;<a name="line.619"></a>
-<FONT color="green">620</FONT>            }<a name="line.620"></a>
-<FONT color="green">621</FONT>    <a name="line.621"></a>
-<FONT color="green">622</FONT>            /**<a name="line.622"></a>
-<FONT color="green">623</FONT>             * {@inheritDoc}<a name="line.623"></a>
-<FONT color="green">624</FONT>             */<a name="line.624"></a>
-<FONT color="green">625</FONT>            @Override<a name="line.625"></a>
-<FONT color="green">626</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.626"></a>
-<FONT color="green">627</FONT>                buffer.append(mValue);<a name="line.627"></a>
-<FONT color="green">628</FONT>            }<a name="line.628"></a>
-<FONT color="green">629</FONT>        }<a name="line.629"></a>
+<FONT color="green">585</FONT>            /**<a name="line.585"></a>
+<FONT color="green">586</FONT>             * Appends the value of the specified calendar to the output buffer based on the rule implementation.<a name="line.586"></a>
+<FONT color="green">587</FONT>             *<a name="line.587"></a>
+<FONT color="green">588</FONT>             * @param buffer the output buffer<a name="line.588"></a>
+<FONT color="green">589</FONT>             * @param calendar calendar to be appended<a name="line.589"></a>
+<FONT color="green">590</FONT>             */<a name="line.590"></a>
+<FONT color="green">591</FONT>            void appendTo(StringBuffer buffer, Calendar calendar);<a name="line.591"></a>
+<FONT color="green">592</FONT>        }<a name="line.592"></a>
+<FONT color="green">593</FONT>    <a name="line.593"></a>
+<FONT color="green">594</FONT>        /**<a name="line.594"></a>
+<FONT color="green">595</FONT>         * &lt;p&gt;Inner class defining a numeric rule.&lt;/p&gt;<a name="line.595"></a>
+<FONT color="green">596</FONT>         */<a name="line.596"></a>
+<FONT color="green">597</FONT>        private interface NumberRule extends Rule {<a name="line.597"></a>
+<FONT color="green">598</FONT>            /**<a name="line.598"></a>
+<FONT color="green">599</FONT>             * Appends the specified value to the output buffer based on the rule implementation.<a name="line.599"></a>
+<FONT color="green">600</FONT>             *<a name="line.600"></a>
+<FONT color="green">601</FONT>             * @param buffer the output buffer<a name="line.601"></a>
+<FONT color="green">602</FONT>             * @param value the value to be appended<a name="line.602"></a>
+<FONT color="green">603</FONT>             */<a name="line.603"></a>
+<FONT color="green">604</FONT>            void appendTo(StringBuffer buffer, int value);<a name="line.604"></a>
+<FONT color="green">605</FONT>        }<a name="line.605"></a>
+<FONT color="green">606</FONT>    <a name="line.606"></a>
+<FONT color="green">607</FONT>        /**<a name="line.607"></a>
+<FONT color="green">608</FONT>         * &lt;p&gt;Inner class to output a constant single character.&lt;/p&gt;<a name="line.608"></a>
+<FONT color="green">609</FONT>         */<a name="line.609"></a>
+<FONT color="green">610</FONT>        private static class CharacterLiteral implements Rule {<a name="line.610"></a>
+<FONT color="green">611</FONT>            private final char mValue;<a name="line.611"></a>
+<FONT color="green">612</FONT>    <a name="line.612"></a>
+<FONT color="green">613</FONT>            /**<a name="line.613"></a>
+<FONT color="green">614</FONT>             * Constructs a new instance of {@code CharacterLiteral}<a name="line.614"></a>
+<FONT color="green">615</FONT>             * to hold the specified value.<a name="line.615"></a>
+<FONT color="green">616</FONT>             *<a name="line.616"></a>
+<FONT color="green">617</FONT>             * @param value the character literal<a name="line.617"></a>
+<FONT color="green">618</FONT>             */<a name="line.618"></a>
+<FONT color="green">619</FONT>            CharacterLiteral(final char value) {<a name="line.619"></a>
+<FONT color="green">620</FONT>                mValue = value;<a name="line.620"></a>
+<FONT color="green">621</FONT>            }<a name="line.621"></a>
+<FONT color="green">622</FONT>    <a name="line.622"></a>
+<FONT color="green">623</FONT>            /**<a name="line.623"></a>
+<FONT color="green">624</FONT>             * {@inheritDoc}<a name="line.624"></a>
+<FONT color="green">625</FONT>             */<a name="line.625"></a>
+<FONT color="green">626</FONT>            @Override<a name="line.626"></a>
+<FONT color="green">627</FONT>            public int estimateLength() {<a name="line.627"></a>
+<FONT color="green">628</FONT>                return 1;<a name="line.628"></a>
+<FONT color="green">629</FONT>            }<a name="line.629"></a>
 <FONT color="green">630</FONT>    <a name="line.630"></a>
-<FONT color="green">631</FONT>        /**<a name="line.631"></a>
-<FONT color="green">632</FONT>         * &lt;p&gt;Inner class to output a constant string.&lt;/p&gt;<a name="line.632"></a>
-<FONT color="green">633</FONT>         */<a name="line.633"></a>
-<FONT color="green">634</FONT>        private static class StringLiteral implements Rule {<a name="line.634"></a>
-<FONT color="green">635</FONT>            private final String mValue;<a name="line.635"></a>
-<FONT color="green">636</FONT>    <a name="line.636"></a>
-<FONT color="green">637</FONT>            /**<a name="line.637"></a>
-<FONT color="green">638</FONT>             * Constructs a new instance of {@code StringLiteral}<a name="line.638"></a>
-<FONT color="green">639</FONT>             * to hold the specified value.<a name="line.639"></a>
-<FONT color="green">640</FONT>             *<a name="line.640"></a>
-<FONT color="green">641</FONT>             * @param value the string literal<a name="line.641"></a>
-<FONT color="green">642</FONT>             */<a name="line.642"></a>
-<FONT color="green">643</FONT>            StringLiteral(final String value) {<a name="line.643"></a>
-<FONT color="green">644</FONT>                mValue = value;<a name="line.644"></a>
-<FONT color="green">645</FONT>            }<a name="line.645"></a>
-<FONT color="green">646</FONT>    <a name="line.646"></a>
-<FONT color="green">647</FONT>            /**<a name="line.647"></a>
-<FONT color="green">648</FONT>             * {@inheritDoc}<a name="line.648"></a>
-<FONT color="green">649</FONT>             */<a name="line.649"></a>
-<FONT color="green">650</FONT>            @Override<a name="line.650"></a>
-<FONT color="green">651</FONT>            public int estimateLength() {<a name="line.651"></a>
-<FONT color="green">652</FONT>                return mValue.length();<a name="line.652"></a>
-<FONT color="green">653</FONT>            }<a name="line.653"></a>
-<FONT color="green">654</FONT>    <a name="line.654"></a>
-<FONT color="green">655</FONT>            /**<a name="line.655"></a>
-<FONT color="green">656</FONT>             * {@inheritDoc}<a name="line.656"></a>
-<FONT color="green">657</FONT>             */<a name="line.657"></a>
-<FONT color="green">658</FONT>            @Override<a name="line.658"></a>
-<FONT color="green">659</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.659"></a>
-<FONT color="green">660</FONT>                buffer.append(mValue);<a name="line.660"></a>
-<FONT color="green">661</FONT>            }<a name="line.661"></a>
-<FONT color="green">662</FONT>        }<a name="line.662"></a>
+<FONT color="green">631</FONT>            /**<a name="line.631"></a>
+<FONT color="green">632</FONT>             * {@inheritDoc}<a name="line.632"></a>
+<FONT color="green">633</FONT>             */<a name="line.633"></a>
+<FONT color="green">634</FONT>            @Override<a name="line.634"></a>
+<FONT color="green">635</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.635"></a>
+<FONT color="green">636</FONT>                buffer.append(mValue);<a name="line.636"></a>
+<FONT color="green">637</FONT>            }<a name="line.637"></a>
+<FONT color="green">638</FONT>        }<a name="line.638"></a>
+<FONT color="green">639</FONT>    <a name="line.639"></a>
+<FONT color="green">640</FONT>        /**<a name="line.640"></a>
+<FONT color="green">641</FONT>         * &lt;p&gt;Inner class to output a constant string.&lt;/p&gt;<a name="line.641"></a>
+<FONT color="green">642</FONT>         */<a name="line.642"></a>
+<FONT color="green">643</FONT>        private static class StringLiteral implements Rule {<a name="line.643"></a>
+<FONT color="green">644</FONT>            private final String mValue;<a name="line.644"></a>
+<FONT color="green">645</FONT>    <a name="line.645"></a>
+<FONT color="green">646</FONT>            /**<a name="line.646"></a>
+<FONT color="green">647</FONT>             * Constructs a new instance of {@code StringLiteral}<a name="line.647"></a>
+<FONT color="green">648</FONT>             * to hold the specified value.<a name="line.648"></a>
+<FONT color="green">649</FONT>             *<a name="line.649"></a>
+<FONT color="green">650</FONT>             * @param value the string literal<a name="line.650"></a>
+<FONT color="green">651</FONT>             */<a name="line.651"></a>
+<FONT color="green">652</FONT>            StringLiteral(final String value) {<a name="line.652"></a>
+<FONT color="green">653</FONT>                mValue = value;<a name="line.653"></a>
+<FONT color="green">654</FONT>            }<a name="line.654"></a>
+<FONT color="green">655</FONT>    <a name="line.655"></a>
+<FONT color="green">656</FONT>            /**<a name="line.656"></a>
+<FONT color="green">657</FONT>             * {@inheritDoc}<a name="line.657"></a>
+<FONT color="green">658</FONT>             */<a name="line.658"></a>
+<FONT color="green">659</FONT>            @Override<a name="line.659"></a>
+<FONT color="green">660</FONT>            public int estimateLength() {<a name="line.660"></a>
+<FONT color="green">661</FONT>                return mValue.length();<a name="line.661"></a>
+<FONT color="green">662</FONT>            }<a name="line.662"></a>
 <FONT color="green">663</FONT>    <a name="line.663"></a>
-<FONT color="green">664</FONT>        /**<a name="line.664"></a>
-<FONT color="green">665</FONT>         * &lt;p&gt;Inner class to output one of a set of values.&lt;/p&gt;<a name="line.665"></a>
-<FONT color="green">666</FONT>         */<a name="line.666"></a>
-<FONT color="green">667</FONT>        private static class TextField implements Rule {<a name="line.667"></a>
-<FONT color="green">668</FONT>            private final int mField;<a name="line.668"></a>
-<FONT color="green">669</FONT>            private final String[] mValues;<a name="line.669"></a>
-<FONT color="green">670</FONT>    <a name="line.670"></a>
-<FONT color="green">671</FONT>            /**<a name="line.671"></a>
-<FONT color="green">672</FONT>             * Constructs an instance of {@code TextField}<a name="line.672"></a>
-<FONT color="green">673</FONT>             * with the specified field and values.<a name="line.673"></a>
-<FONT color="green">674</FONT>             *<a name="line.674"></a>
-<FONT color="green">675</FONT>             * @param field the field<a name="line.675"></a>
-<FONT color="green">676</FONT>             * @param values the field values<a name="line.676"></a>
-<FONT color="green">677</FONT>             */<a name="line.677"></a>
-<FONT color="green">678</FONT>            TextField(final int field, final String[] values) {<a name="line.678"></a>
-<FONT color="green">679</FONT>                mField = field;<a name="line.679"></a>
-<FONT color="green">680</FONT>                mValues = values;<a name="line.680"></a>
-<FONT color="green">681</FONT>            }<a name="line.681"></a>
-<FONT color="green">682</FONT>    <a name="line.682"></a>
-<FONT color="green">683</FONT>            /**<a name="line.683"></a>
-<FONT color="green">684</FONT>             * {@inheritDoc}<a name="line.684"></a>
-<FONT color="green">685</FONT>             */<a name="line.685"></a>
-<FONT color="green">686</FONT>            @Override<a name="line.686"></a>
-<FONT color="green">687</FONT>            public int estimateLength() {<a name="line.687"></a>
-<FONT color="green">688</FONT>                int max = 0;<a name="line.688"></a>
-<FONT color="green">689</FONT>                for (int i=mValues.length; --i &gt;= 0; ) {<a name="line.689"></a>
-<FONT color="green">690</FONT>                    final int len = mValues[i].length();<a name="line.690"></a>
-<FONT color="green">691</FONT>                    if (len &gt; max) {<a name="line.691"></a>
-<FONT color="green">692</FONT>                        max = len;<a name="line.692"></a>
-<FONT color="green">693</FONT>                    }<a name="line.693"></a>
-<FONT color="green">694</FONT>                }<a name="line.694"></a>
-<FONT color="green">695</FONT>                return max;<a name="line.695"></a>
-<FONT color="green">696</FONT>            }<a name="line.696"></a>
-<FONT color="green">697</FONT>    <a name="line.697"></a>
-<FONT color="green">698</FONT>            /**<a name="line.698"></a>
-<FONT color="green">699</FONT>             * {@inheritDoc}<a name="line.699"></a>
-<FONT color="green">700</FONT>             */<a name="line.700"></a>
-<FONT color="green">701</FONT>            @Override<a name="line.701"></a>
-<FONT color="green">702</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.702"></a>
-<FONT color="green">703</FONT>                buffer.append(mValues[calendar.get(mField)]);<a name="line.703"></a>
-<FONT color="green">704</FONT>            }<a name="line.704"></a>
-<FONT color="green">705</FONT>        }<a name="line.705"></a>
+<FONT color="green">664</FONT>            /**<a name="line.664"></a>
+<FONT color="green">665</FONT>             * {@inheritDoc}<a name="line.665"></a>
+<FONT color="green">666</FONT>             */<a name="line.666"></a>
+<FONT color="green">667</FONT>            @Override<a name="line.667"></a>
+<FONT color="green">668</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.668"></a>
+<FONT color="green">669</FONT>                buffer.append(mValue);<a name="line.669"></a>
+<FONT color="green">670</FONT>            }<a name="line.670"></a>
+<FONT color="green">671</FONT>        }<a name="line.671"></a>
+<FONT color="green">672</FONT>    <a name="line.672"></a>
+<FONT color="green">673</FONT>        /**<a name="line.673"></a>
+<FONT color="green">674</FONT>         * &lt;p&gt;Inner class to output one of a set of values.&lt;/p&gt;<a name="line.674"></a>
+<FONT color="green">675</FONT>         */<a name="line.675"></a>
+<FONT color="green">676</FONT>        private static class TextField implements Rule {<a name="line.676"></a>
+<FONT color="green">677</FONT>            private final int mField;<a name="line.677"></a>
+<FONT color="green">678</FONT>            private final String[] mValues;<a name="line.678"></a>
+<FONT color="green">679</FONT>    <a name="line.679"></a>
+<FONT color="green">680</FONT>            /**<a name="line.680"></a>
+<FONT color="green">681</FONT>             * Constructs an instance of {@code TextField}<a name="line.681"></a>
+<FONT color="green">682</FONT>             * with the specified field and values.<a name="line.682"></a>
+<FONT color="green">683</FONT>             *<a name="line.683"></a>
+<FONT color="green">684</FONT>             * @param field the field<a name="line.684"></a>
+<FONT color="green">685</FONT>             * @param values the field values<a name="line.685"></a>
+<FONT color="green">686</FONT>             */<a name="line.686"></a>
+<FONT color="green">687</FONT>            TextField(final int field, final String[] values) {<a name="line.687"></a>
+<FONT color="green">688</FONT>                mField = field;<a name="line.688"></a>
+<FONT color="green">689</FONT>                mValues = values;<a name="line.689"></a>
+<FONT color="green">690</FONT>            }<a name="line.690"></a>
+<FONT color="green">691</FONT>    <a name="line.691"></a>
+<FONT color="green">692</FONT>            /**<a name="line.692"></a>
+<FONT color="green">693</FONT>             * {@inheritDoc}<a name="line.693"></a>
+<FONT color="green">694</FONT>             */<a name="line.694"></a>
+<FONT color="green">695</FONT>            @Override<a name="line.695"></a>
+<FONT color="green">696</FONT>            public int estimateLength() {<a name="line.696"></a>
+<FONT color="green">697</FONT>                int max = 0;<a name="line.697"></a>
+<FONT color="green">698</FONT>                for (int i=mValues.length; --i &gt;= 0; ) {<a name="line.698"></a>
+<FONT color="green">699</FONT>                    final int len = mValues[i].length();<a name="line.699"></a>
+<FONT color="green">700</FONT>                    if (len &gt; max) {<a name="line.700"></a>
+<FONT color="green">701</FONT>                        max = len;<a name="line.701"></a>
+<FONT color="green">702</FONT>                    }<a name="line.702"></a>
+<FONT color="green">703</FONT>                }<a name="line.703"></a>
+<FONT color="green">704</FONT>                return max;<a name="line.704"></a>
+<FONT color="green">705</FONT>            }<a name="line.705"></a>
 <FONT color="green">706</FONT>    <a name="line.706"></a>
-<FONT color="green">707</FONT>        /**<a name="line.707"></a>
-<FONT color="green">708</FONT>         * &lt;p&gt;Inner class to output an unpadded number.&lt;/p&gt;<a name="line.708"></a>
-<FONT color="green">709</FONT>         */<a name="line.709"></a>
-<FONT color="green">710</FONT>        private static class UnpaddedNumberField implements NumberRule {<a name="line.710"></a>
-<FONT color="green">711</FONT>            private final int mField;<a name="line.711"></a>
-<FONT color="green">712</FONT>    <a name="line.712"></a>
-<FONT color="green">713</FONT>            /**<a name="line.713"></a>
-<FONT color="green">714</FONT>             * Constructs an instance of {@code UnpadedNumberField} with the specified field.<a name="line.714"></a>
-<FONT color="green">715</FONT>             *<a name="line.715"></a>
-<FONT color="green">716</FONT>             * @param field the field<a name="line.716"></a>
-<FONT color="green">717</FONT>             */<a name="line.717"></a>
-<FONT color="green">718</FONT>            UnpaddedNumberField(final int field) {<a name="line.718"></a>
-<FONT color="green">719</FONT>                mField = field;<a name="line.719"></a>
-<FONT color="green">720</FONT>            }<a name="line.720"></a>
+<FONT color="green">707</FONT>            /**<a name="line.707"></a>
+<FONT color="green">708</FONT>             * {@inheritDoc}<a name="line.708"></a>
+<FONT color="green">709</FONT>             */<a name="line.709"></a>
+<FONT color="green">710</FONT>            @Override<a name="line.710"></a>
+<FONT color="green">711</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.711"></a>
+<FONT color="green">712</FONT>                buffer.append(mValues[calendar.get(mField)]);<a name="line.712"></a>
+<FONT color="green">713</FONT>            }<a name="line.713"></a>
+<FONT color="green">714</FONT>        }<a name="line.714"></a>
+<FONT color="green">715</FONT>    <a name="line.715"></a>
+<FONT color="green">716</FONT>        /**<a name="line.716"></a>
+<FONT color="green">717</FONT>         * &lt;p&gt;Inner class to output an unpadded number.&lt;/p&gt;<a name="line.717"></a>
+<FONT color="green">718</FONT>         */<a name="line.718"></a>
+<FONT color="green">719</FONT>        private static class UnpaddedNumberField implements NumberRule {<a name="line.719"></a>
+<FONT color="green">720</FONT>            private final int mField;<a name="line.720"></a>
 <FONT color="green">721</FONT>    <a name="line.721"></a>
 <FONT color="green">722</FONT>            /**<a name="line.722"></a>
-<FONT color="green">723</FONT>             * {@inheritDoc}<a name="line.723"></a>
-<FONT color="green">724</FONT>             */<a name="line.724"></a>
-<FONT color="green">725</FONT>            @Override<a name="line.725"></a>
-<FONT color="green">726</FONT>            public int estimateLength() {<a name="line.726"></a>
-<FONT color="green">727</FONT>                return 4;<a name="line.727"></a>
-<FONT color="green">728</FONT>            }<a name="line.728"></a>
-<FONT color="green">729</FONT>    <a name="line.729"></a>
-<FONT color="green">730</FONT>            /**<a name="line.730"></a>
-<FONT color="green">731</FONT>             * {@inheritDoc}<a name="line.731"></a>
-<FONT color="green">732</FONT>             */<a name="line.732"></a>
-<FONT color="green">733</FONT>            @Override<a name="line.733"></a>
-<FONT color="green">734</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.734"></a>
-<FONT color="green">735</FONT>                appendTo(buffer, calendar.get(mField));<a name="line.735"></a>
-<FONT color="green">736</FONT>            }<a name="line.736"></a>
-<FONT color="green">737</FONT>    <a name="line.737"></a>
-<FONT color="green">738</FONT>            /**<a name="line.738"></a>
-<FONT color="green">739</FONT>             * {@inheritDoc}<a name="line.739"></a>
-<FONT color="green">740</FONT>             */<a name="line.740"></a>
-<FONT color="green">741</FONT>            @Override<a name="line.741"></a>
-<FONT color="green">742</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.742"></a>
-<FONT color="green">743</FONT>                if (value &lt; 10) {<a name="line.743"></a>
-<FONT color="green">744</FONT>                    buffer.append((char)(value + '0'));<a name="line.744"></a>
-<FONT color="green">745</FONT>                } else if (value &lt; 100) {<a name="line.745"></a>
-<FONT color="green">746</FONT>                    buffer.append((char)(value / 10 + '0'));<a name="line.746"></a>
-<FONT color="green">747</FONT>                    buffer.append((char)(value % 10 + '0'));<a name="line.747"></a>
-<FONT color="green">748</FONT>                } else {<a name="line.748"></a>
-<FONT color="green">749</FONT>                    buffer.append(Integer.toString(value));<a name="line.749"></a>
-<FONT color="green">750</FONT>                }<a name="line.750"></a>
-<FONT color="green">751</FONT>            }<a name="line.751"></a>
-<FONT color="green">752</FONT>        }<a name="line.752"></a>
-<FONT color="green">753</FONT>    <a name="line.753"></a>
-<FONT color="green">754</FONT>        /**<a name="line.754"></a>
-<FONT color="green">755</FONT>         * &lt;p&gt;Inner class to output an unpadded month.&lt;/p&gt;<a name="line.755"></a>
-<FONT color="green">756</FONT>         */<a name="line.756"></a>
-<FONT color="green">757</FONT>        private static class UnpaddedMonthField implements NumberRule {<a name="line.757"></a>
-<FONT color="green">758</FONT>            static final UnpaddedMonthField INSTANCE = new UnpaddedMonthField();<a name="line.758"></a>
-<FONT color="green">759</FONT>    <a name="line.759"></a>
-<FONT color="green">760</FONT>            /**<a name="line.760"></a>
-<FONT color="green">761</FONT>             * Constructs an instance of {@code UnpaddedMonthField}.<a name="line.761"></a>
-<FONT color="green">762</FONT>             *<a name="line.762"></a>
-<FONT color="green">763</FONT>             */<a name="line.763"></a>
-<FONT color="green">764</FONT>            UnpaddedMonthField() {<a name="line.764"></a>
-<FONT color="green">765</FONT>                super();<a name="line.765"></a>
-<FONT color="green">766</FONT>            }<a name="line.766"></a>
-<FONT color="green">767</FONT>    <a name="line.767"></a>
-<FONT color="green">768</FONT>            /**<a name="line.768"></a>
-<FONT color="green">769</FONT>             * {@inheritDoc}<a name="line.769"></a>
-<FONT color="green">770</FONT>             */<a name="line.770"></a>
-<FONT color="green">771</FONT>            @Override<a name="line.771"></a>
-<FONT color="green">772</FONT>            public int estimateLength() {<a name="line.772"></a>
-<FONT color="green">773</FONT>                return 2;<a name="line.773"></a>
-<FONT color="green">774</FONT>            }<a name="line.774"></a>
-<FONT color="green">775</FONT>    <a name="line.775"></a>
-<FONT color="green">776</FONT>            /**<a name="line.776"></a>
-<FONT color="green">777</FONT>             * {@inheritDoc}<a name="line.777"></a>
-<FONT color="green">778</FONT>             */<a name="line.778"></a>
-<FONT color="green">779</FONT>            @Override<a name="line.779"></a>
-<FONT color="green">780</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.780"></a>
-<FONT color="green">781</FONT>                appendTo(buffer, calendar.get(Calendar.MONTH) + 1);<a name="line.781"></a>
-<FONT color="green">782</FONT>            }<a name="line.782"></a>
-<FONT color="green">783</FONT>    <a name="line.783"></a>
-<FONT color="green">784</FONT>            /**<a name="line.784"></a>
-<FONT color="green">785</FONT>             * {@inheritDoc}<a name="line.785"></a>
-<FONT color="green">786</FONT>             */<a name="line.786"></a>
-<FONT color="green">787</FONT>            @Override<a name="line.787"></a>
-<FONT color="green">788</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.788"></a>
-<FONT color="green">789</FONT>                if (value &lt; 10) {<a name="line.789"></a>
-<FONT color="green">790</FONT>                    buffer.append((char)(value + '0'));<a name="line.790"></a>
-<FONT color="green">791</FONT>                } else {<a name="line.791"></a>
-<FONT color="green">792</FONT>                    buffer.append((char)(value / 10 + '0'));<a name="line.792"></a>
-<FONT color="green">793</FONT>                    buffer.append((char)(value % 10 + '0'));<a name="line.793"></a>
-<FONT color="green">794</FONT>                }<a name="line.794"></a>
-<FONT color="green">795</FONT>            }<a name="line.795"></a>
-<FONT color="green">796</FONT>        }<a name="line.796"></a>
-<FONT color="green">797</FONT>    <a name="line.797"></a>
-<FONT color="green">798</FONT>        /**<a name="line.798"></a>
-<FONT color="green">799</FONT>         * &lt;p&gt;Inner class to output a padded number.&lt;/p&gt;<a name="line.799"></a>
-<FONT color="green">800</FONT>         */<a name="line.800"></a>
-<FONT color="green">801</FONT>        private static class PaddedNumberField implements NumberRule {<a name="line.801"></a>
-<FONT color="green">802</FONT>            private final int mField;<a name="line.802"></a>
-<FONT color="green">803</FONT>            private final int mSize;<a name="line.803"></a>
-<FONT color="green">804</FONT>    <a name="line.804"></a>
-<FONT color="green">805</FONT>            /**<a name="line.805"></a>
-<FONT color="green">806</FONT>             * Constructs an instance of {@code PaddedNumberField}.<a name="line.806"></a>
-<FONT color="green">807</FONT>             *<a name="line.807"></a>
-<FONT color="green">808</FONT>             * @param field the field<a name="line.808"></a>
-<FONT color="green">809</FONT>             * @param size size of the output field<a name="line.809"></a>
-<FONT color="green">810</FONT>             */<a name="line.810"></a>
-<FONT color="green">811</FONT>            PaddedNumberField(final int field, final int size) {<a name="line.811"></a>
-<FONT color="green">812</FONT>                if (size &lt; 3) {<a name="line.812"></a>
-<FONT color="green">813</FONT>                    // Should use UnpaddedNumberField or TwoDigitNumberField.<a name="line.813"></a>
-<FONT color="green">814</FONT>                    throw new IllegalArgumentException();<a name="line.814"></a>
-<FONT color="green">815</FONT>                }<a name="line.815"></a>
-<FONT color="green">816</FONT>                mField = field;<a name="line.816"></a>
-<FONT color="green">817</FONT>                mSize = size;<a name="line.817"></a>
-<FONT color="green">818</FONT>            }<a name="line.818"></a>
-<FONT color="green">819</FONT>    <a name="line.819"></a>
-<FONT color="green">820</FONT>            /**<a name="line.820"></a>
-<FONT color="green">821</FONT>             * {@inheritDoc}<a name="line.821"></a>
-<FONT color="green">822</FONT>             */<a name="line.822"></a>
-<FONT color="green">823</FONT>            @Override<a name="line.823"></a>
-<FONT color="green">824</FONT>            public int estimateLength() {<a name="line.824"></a>
-<FONT color="green">825</FONT>                return 4;<a name="line.825"></a>
-<FONT color="green">826</FONT>            }<a name="line.826"></a>
-<FONT color="green">827</FONT>    <a name="line.827"></a>
-<FONT color="green">828</FONT>            /**<a name="line.828"></a>
-<FONT color="green">829</FONT>             * {@inheritDoc}<a name="line.829"></a>
-<FONT color="green">830</FONT>             */<a name="line.830"></a>
-<FONT color="green">831</FONT>            @Override<a name="line.831"></a>
-<FONT color="green">832</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.832"></a>
-<FONT color="green">833</FONT>                appendTo(buffer, calendar.get(mField));<a name="line.833"></a>
-<FONT color="green">834</FONT>            }<a name="line.834"></a>
-<FONT color="green">835</FONT>    <a name="line.835"></a>
-<FONT color="green">836</FONT>            /**<a name="line.836"></a>
-<FONT color="green">837</FONT>             * {@inheritDoc}<a name="line.837"></a>
-<FONT color="green">838</FONT>             */<a name="line.838"></a>
-<FONT color="green">839</FONT>            @Override<a name="line.839"></a>
-<FONT color="green">840</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.840"></a>
-<FONT color="green">841</FONT>                if (value &lt; 100) {<a name="line.841"></a>
-<FONT color="green">842</FONT>                    for (int i = mSize; --i &gt;= 2; ) {<a name="line.842"></a>
-<FONT color="green">843</FONT>                        buffer.append('0');<a name="line.843"></a>
-<FONT color="green">844</FONT>                    }<a name="line.844"></a>
-<FONT color="green">845</FONT>                    buffer.append((char)(value / 10 + '0'));<a name="line.845"></a>
-<FONT color="green">846</FONT>                    buffer.append((char)(value % 10 + '0'));<a name="line.846"></a>
-<FONT color="green">847</FONT>                } else {<a name="line.847"></a>
-<FONT color="green">848</FONT>                    int digits;<a name="line.848"></a>
-<FONT color="green">849</FONT>                    if (value &lt; 1000) {<a name="line.849"></a>
-<FONT color="green">850</FONT>                        digits = 3;<a name="line.850"></a>
-<FONT color="green">851</FONT>                    } else {<a name="line.851"></a>
-<FONT color="green">852</FONT>                        Validate.isTrue(value &gt; -1, "Negative values should not be possible", value);<a name="line.852"></a>
-<FONT color="green">853</FONT>                        digits = Integer.toString(value).length();<a name="line.853"></a>
-<FONT color="green">854</FONT>                    }<a name="line.854"></a>
-<FONT color="green">855</FONT>                    for (int i = mSize; --i &gt;= digits; ) {<a name="line.855"></a>
-<FONT color="green">856</FONT>                        buffer.append('0');<a name="line.856"></a>
-<FONT color="green">857</FONT>                    }<a name="line.857"></a>
-<FONT color="green">858</FONT>                    buffer.append(Integer.toString(value));<a name="line.858"></a>
-<FONT color="green">859</FONT>                }<a name="line.859"></a>
-<FONT color="green">860</FONT>            }<a name="line.860"></a>
-<FONT color="green">861</FONT>        }<a name="line.861"></a>
-<FONT color="green">862</FONT>    <a name="line.862"></a>
-<FONT color="green">863</FONT>        /**<a name="line.863"></a>
-<FONT color="green">864</FONT>         * &lt;p&gt;Inner class to output a two digit number.&lt;/p&gt;<a name="line.864"></a>
-<FONT color="green">865</FONT>         */<a name="line.865"></a>
-<FONT color="green">866</FONT>        private static class TwoDigitNumberField implements NumberRule {<a name="line.866"></a>
-<FONT color="green">867</FONT>            private final int mField;<a name="line.867"></a>
-<FONT color="green">868</FONT>    <a name="line.868"></a>
-<FONT color="green">869</FONT>            /**<a name="line.869"></a>
-<FONT color="green">870</FONT>             * Constructs an instance of {@code TwoDigitNumberField} with the specified field.<a name="line.870"></a>
-<FONT color="green">871</FONT>             *<a name="line.871"></a>
-<FONT color="green">872</FONT>             * @param field the field<a name="line.872"></a>
-<FONT color="green">873</FONT>             */<a name="line.873"></a>
-<FONT color="green">874</FONT>            TwoDigitNumberField(final int field) {<a name="line.874"></a>
-<FONT color="green">875</FONT>                mField = field;<a name="line.875"></a>
-<FONT color="green">876</FONT>            }<a name="line.876"></a>
+<FONT color="green">723</FONT>             * Constructs an instance of {@code UnpadedNumberField} with the specified field.<a name="line.723"></a>
+<FONT color="green">724</FONT>             *<a name="line.724"></a>
+<FONT color="green">725</FONT>             * @param field the field<a name="line.725"></a>
+<FONT color="green">726</FONT>             */<a name="line.726"></a>
+<FONT color="green">727</FONT>            UnpaddedNumberField(final int field) {<a name="line.727"></a>
+<FONT color="green">728</FONT>                mField = field;<a name="line.728"></a>
+<FONT color="green">729</FONT>            }<a name="line.729"></a>
+<FONT color="green">730</FONT>    <a name="line.730"></a>
+<FONT color="green">731</FONT>            /**<a name="line.731"></a>
+<FONT color="green">732</FONT>             * {@inheritDoc}<a name="line.732"></a>
+<FONT color="green">733</FONT>             */<a name="line.733"></a>
+<FONT color="green">734</FONT>            @Override<a name="line.734"></a>
+<FONT color="green">735</FONT>            public int estimateLength() {<a name="line.735"></a>
+<FONT color="green">736</FONT>                return 4;<a name="line.736"></a>
+<FONT color="green">737</FONT>            }<a name="line.737"></a>
+<FONT color="green">738</FONT>    <a name="line.738"></a>
+<FONT color="green">739</FONT>            /**<a name="line.739"></a>
+<FONT color="green">740</FONT>             * {@inheritDoc}<a name="line.740"></a>
+<FONT color="green">741</FONT>             */<a name="line.741"></a>
+<FONT color="green">742</FONT>            @Override<a name="line.742"></a>
+<FONT color="green">743</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.743"></a>
+<FONT color="green">744</FONT>                appendTo(buffer, calendar.get(mField));<a name="line.744"></a>
+<FONT color="green">745</FONT>            }<a name="line.745"></a>
+<FONT color="green">746</FONT>    <a name="line.746"></a>
+<FONT color="green">747</FONT>            /**<a name="line.747"></a>
+<FONT color="green">748</FONT>             * {@inheritDoc}<a name="line.748"></a>
+<FONT color="green">749</FONT>             */<a name="line.749"></a>
+<FONT color="green">750</FONT>            @Override<a name="line.750"></a>
+<FONT color="green">751</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.751"></a>
+<FONT color="green">752</FONT>                if (value &lt; 10) {<a name="line.752"></a>
+<FONT color="green">753</FONT>                    buffer.append((char)(value + '0'));<a name="line.753"></a>
+<FONT color="green">754</FONT>                } else if (value &lt; 100) {<a name="line.754"></a>
+<FONT color="green">755</FONT>                    buffer.append((char)(value / 10 + '0'));<a name="line.755"></a>
+<FONT color="green">756</FONT>                    buffer.append((char)(value % 10 + '0'));<a name="line.756"></a>
+<FONT color="green">757</FONT>                } else {<a name="line.757"></a>
+<FONT color="green">758</FONT>                    buffer.append(Integer.toString(value));<a name="line.758"></a>
+<FONT color="green">759</FONT>                }<a name="line.759"></a>
+<FONT color="green">760</FONT>            }<a name="line.760"></a>
+<FONT color="green">761</FONT>        }<a name="line.761"></a>
+<FONT color="green">762</FONT>    <a name="line.762"></a>
+<FONT color="green">763</FONT>        /**<a name="line.763"></a>
+<FONT color="green">764</FONT>         * &lt;p&gt;Inner class to output an unpadded month.&lt;/p&gt;<a name="line.764"></a>
+<FONT color="green">765</FONT>         */<a name="line.765"></a>
+<FONT color="green">766</FONT>        private static class UnpaddedMonthField implements NumberRule {<a name="line.766"></a>
+<FONT color="green">767</FONT>            static final UnpaddedMonthField INSTANCE = new UnpaddedMonthField();<a name="line.767"></a>
+<FONT color="green">768</FONT>    <a name="line.768"></a>
+<FONT color="green">769</FONT>            /**<a name="line.769"></a>
+<FONT color="green">770</FONT>             * Constructs an instance of {@code UnpaddedMonthField}.<a name="line.770"></a>
+<FONT color="green">771</FONT>             *<a name="line.771"></a>
+<FONT color="green">772</FONT>             */<a name="line.772"></a>
+<FONT color="green">773</FONT>            UnpaddedMonthField() {<a name="line.773"></a>
+<FONT color="green">774</FONT>                super();<a name="line.774"></a>
+<FONT color="green">775</FONT>            }<a name="line.775"></a>
+<FONT color="green">776</FONT>    <a name="line.776"></a>
+<FONT color="green">777</FONT>            /**<a name="line.777"></a>
+<FONT color="green">778</FONT>             * {@inheritDoc}<a name="line.778"></a>
+<FONT color="green">779</FONT>             */<a name="line.779"></a>
+<FONT color="green">780</FONT>            @Override<a name="line.780"></a>
+<FONT color="green">781</FONT>            public int estimateLength() {<a name="line.781"></a>
+<FONT color="green">782</FONT>                return 2;<a name="line.782"></a>
+<FONT color="green">783</FONT>            }<a name="line.783"></a>
+<FONT color="green">784</FONT>    <a name="line.784"></a>
+<FONT color="green">785</FONT>            /**<a name="line.785"></a>
+<FONT color="green">786</FONT>             * {@inheritDoc}<a name="line.786"></a>
+<FONT color="green">787</FONT>             */<a name="line.787"></a>
+<FONT color="green">788</FONT>            @Override<a name="line.788"></a>
+<FONT color="green">789</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.789"></a>
+<FONT color="green">790</FONT>                appendTo(buffer, calendar.get(Calendar.MONTH) + 1);<a name="line.790"></a>
+<FONT color="green">791</FONT>            }<a name="line.791"></a>
+<FONT color="green">792</FONT>    <a name="line.792"></a>
+<FONT color="green">793</FONT>            /**<a name="line.793"></a>
+<FONT color="green">794</FONT>             * {@inheritDoc}<a name="line.794"></a>
+<FONT color="green">795</FONT>             */<a name="line.795"></a>
+<FONT color="green">796</FONT>            @Override<a name="line.796"></a>
+<FONT color="green">797</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.797"></a>
+<FONT color="green">798</FONT>                if (value &lt; 10) {<a name="line.798"></a>
+<FONT color="green">799</FONT>                    buffer.append((char)(value + '0'));<a name="line.799"></a>
+<FONT color="green">800</FONT>                } else {<a name="line.800"></a>
+<FONT color="green">801</FONT>                    buffer.append((char)(value / 10 + '0'));<a name="line.801"></a>
+<FONT color="green">802</FONT>                    buffer.append((char)(value % 10 + '0'));<a name="line.802"></a>
+<FONT color="green">803</FONT>                }<a name="line.803"></a>
+<FONT color="green">804</FONT>            }<a name="line.804"></a>
+<FONT color="green">805</FONT>        }<a name="line.805"></a>
+<FONT color="green">806</FONT>    <a name="line.806"></a>
+<FONT color="green">807</FONT>        /**<a name="line.807"></a>
+<FONT color="green">808</FONT>         * &lt;p&gt;Inner class to output a padded number.&lt;/p&gt;<a name="line.808"></a>
+<FONT color="green">809</FONT>         */<a name="line.809"></a>
+<FONT color="green">810</FONT>        private static class PaddedNumberField implements NumberRule {<a name="line.810"></a>
+<FONT color="green">811</FONT>            private final int mField;<a name="line.811"></a>
+<FONT color="green">812</FONT>            private final int mSize;<a name="line.812"></a>
+<FONT color="green">813</FONT>    <a name="line.813"></a>
+<FONT color="green">814</FONT>            /**<a name="line.814"></a>
+<FONT color="green">815</FONT>             * Constructs an instance of {@code PaddedNumberField}.<a name="line.815"></a>
+<FONT color="green">816</FONT>             *<a name="line.816"></a>
+<FONT color="green">817</FONT>             * @param field the field<a name="line.817"></a>
+<FONT color="green">818</FONT>             * @param size size of the output field<a name="line.818"></a>
+<FONT color="green">819</FONT>             */<a name="line.819"></a>
+<FONT color="green">820</FONT>            PaddedNumberField(final int field, final int size) {<a name="line.820"></a>
+<FONT color="green">821</FONT>                if (size &lt; 3) {<a name="line.821"></a>
+<FONT color="green">822</FONT>                    // Should use UnpaddedNumberField or TwoDigitNumberField.<a name="line.822"></a>
+<FONT color="green">823</FONT>                    throw new IllegalArgumentException();<a name="line.823"></a>
+<FONT color="green">824</FONT>                }<a name="line.824"></a>
+<FONT color="green">825</FONT>                mField = field;<a name="line.825"></a>
+<FONT color="green">826</FONT>                mSize = size;<a name="line.826"></a>
+<FONT color="green">827</FONT>            }<a name="line.827"></a>
+<FONT color="green">828</FONT>    <a name="line.828"></a>
+<FONT color="green">829</FONT>            /**<a name="line.829"></a>
+<FONT color="green">830</FONT>             * {@inheritDoc}<a name="line.830"></a>
+<FONT color="green">831</FONT>             */<a name="line.831"></a>
+<FONT color="green">832</FONT>            @Override<a name="line.832"></a>
+<FONT color="green">833</FONT>            public int estimateLength() {<a name="line.833"></a>
+<FONT color="green">834</FONT>                return 4;<a name="line.834"></a>
+<FONT color="green">835</FONT>            }<a name="line.835"></a>
+<FONT color="green">836</FONT>    <a name="line.836"></a>
+<FONT color="green">837</FONT>            /**<a name="line.837"></a>
+<FONT color="green">838</FONT>             * {@inheritDoc}<a name="line.838"></a>
+<FONT color="green">839</FONT>             */<a name="line.839"></a>
+<FONT color="green">840</FONT>            @Override<a name="line.840"></a>
+<FONT color="green">841</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.841"></a>
+<FONT color="green">842</FONT>                appendTo(buffer, calendar.get(mField));<a name="line.842"></a>
+<FONT color="green">843</FONT>            }<a name="line.843"></a>
+<FONT color="green">844</FONT>    <a name="line.844"></a>
+<FONT color="green">845</FONT>            /**<a name="line.845"></a>
+<FONT color="green">846</FONT>             * {@inheritDoc}<a name="line.846"></a>
+<FONT color="green">847</FONT>             */<a name="line.847"></a>
+<FONT color="green">848</FONT>            @Override<a name="line.848"></a>
+<FONT color="green">849</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.849"></a>
+<FONT color="green">850</FONT>                if (value &lt; 100) {<a name="line.850"></a>
+<FONT color="green">851</FONT>                    for (int i = mSize; --i &gt;= 2; ) {<a name="line.851"></a>
+<FONT color="green">852</FONT>                        buffer.append('0');<a name="line.852"></a>
+<FONT color="green">853</FONT>                    }<a name="line.853"></a>
+<FONT color="green">854</FONT>                    buffer.append((char)(value / 10 + '0'));<a name="line.854"></a>
+<FONT color="green">855</FONT>                    buffer.append((char)(value % 10 + '0'));<a name="line.855"></a>
+<FONT color="green">856</FONT>                } else {<a name="line.856"></a>
+<FONT color="green">857</FONT>                    int digits;<a name="line.857"></a>
+<FONT color="green">858</FONT>                    if (value &lt; 1000) {<a name="line.858"></a>
+<FONT color="green">859</FONT>                        digits = 3;<a name="line.859"></a>
+<FONT color="green">860</FONT>                    } else {<a name="line.860"></a>
+<FONT color="green">861</FONT>                        Validate.isTrue(value &gt; -1, "Negative values should not be possible", value);<a name="line.861"></a>
+<FONT color="green">862</FONT>                        digits = Integer.toString(value).length();<a name="line.862"></a>
+<FONT color="green">863</FONT>                    }<a name="line.863"></a>
+<FONT color="green">864</FONT>                    for (int i = mSize; --i &gt;= digits; ) {<a name="line.864"></a>
+<FONT color="green">865</FONT>                        buffer.append('0');<a name="line.865"></a>
+<FONT color="green">866</FONT>                    }<a name="line.866"></a>
+<FONT color="green">867</FONT>                    buffer.append(Integer.toString(value));<a name="line.867"></a>
+<FONT color="green">868</FONT>                }<a name="line.868"></a>
+<FONT color="green">869</FONT>            }<a name="line.869"></a>
+<FONT color="green">870</FONT>        }<a name="line.870"></a>
+<FONT color="green">871</FONT>    <a name="line.871"></a>
+<FONT color="green">872</FONT>        /**<a name="line.872"></a>
+<FONT color="green">873</FONT>         * &lt;p&gt;Inner class to output a two digit number.&lt;/p&gt;<a name="line.873"></a>
+<FONT color="green">874</FONT>         */<a name="line.874"></a>
+<FONT color="green">875</FONT>        private static class TwoDigitNumberField implements NumberRule {<a name="line.875"></a>
+<FONT color="green">876</FONT>            private final int mField;<a name="line.876"></a>
 <FONT color="green">877</FONT>    <a name="line.877"></a>
 <FONT color="green">878</FONT>            /**<a name="line.878"></a>
-<FONT color="green">879</FONT>             * {@inheritDoc}<a name="line.879"></a>
-<FONT color="green">880</FONT>             */<a name="line.880"></a>
-<FONT color="green">881</FONT>            @Override<a name="line.881"></a>
-<FONT color="green">882</FONT>            public int estimateLength() {<a name="line.882"></a>
-<FONT color="green">883</FONT>                return 2;<a name="line.883"></a>
-<FONT color="green">884</FONT>            }<a name="line.884"></a>
-<FONT color="green">885</FONT>    <a name="line.885"></a>
-<FONT color="green">886</FONT>            /**<a name="line.886"></a>
-<FONT color="green">887</FONT>             * {@inheritDoc}<a name="line.887"></a>
-<FONT color="green">888</FONT>             */<a name="line.888"></a>
-<FONT color="green">889</FONT>            @Override<a name="line.889"></a>
-<FONT color="green">890</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.890"></a>
-<FONT color="green">891</FONT>                appendTo(buffer, calendar.get(mField));<a name="line.891"></a>
-<FONT color="green">892</FONT>            }<a name="line.892"></a>
-<FONT color="green">893</FONT>    <a name="line.893"></a>
-<FONT color="green">894</FONT>            /**<a name="line.894"></a>
-<FONT color="green">895</FONT>             * {@inheritDoc}<a name="line.895"></a>
-<FONT color="green">896</FONT>             */<a name="line.896"></a>
-<FONT color="green">897</FONT>            @Override<a name="line.897"></a>
-<FONT color="green">898</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.898"></a>
-<FONT color="green">899</FONT>                if (value &lt; 100) {<a name="line.899"></a>
-<FONT color="green">900</FONT>                    buffer.append((char)(value / 10 + '0'));<a name="line.900"></a>
-<FONT color="green">901</FONT>                    buffer.append((char)(value % 10 + '0'));<a name="line.901"></a>
-<FONT color="green">902</FONT>                } else {<a name="line.902"></a>
-<FONT color="green">903</FONT>                    buffer.append(Integer.toString(value));<a name="line.903"></a>
-<FONT color="green">904</FONT>                }<a name="line.904"></a>
-<FONT color="green">905</FONT>            }<a name="line.905"></a>
-<FONT color="green">906</FONT>        }<a name="line.906"></a>
-<FONT color="green">907</FONT>    <a name="line.907"></a>
-<FONT color="green">908</FONT>        /**<a name="line.908"></a>
-<FONT color="green">909</FONT>         * &lt;p&gt;Inner class to output a two digit year.&lt;/p&gt;<a name="line.909"></a>
-<FONT color="green">910</FONT>         */<a name="line.910"></a>
-<FONT color="green">911</FONT>        private static class TwoDigitYearField implements NumberRule {<a name="line.911"></a>
-<FONT color="green">912</FONT>            static final TwoDigitYearField INSTANCE = new TwoDigitYearField();<a name="line.912"></a>
-<FONT color="green">913</FONT>    <a name="line.913"></a>
-<FONT color="green">914</FONT>            /**<a name="line.914"></a>
-<FONT color="green">915</FONT>             * Constructs an instance of {@code TwoDigitYearField}.<a name="line.915"></a>
-<FONT color="green">916</FONT>             */<a name="line.916"></a>
-<FONT color="green">917</FONT>            TwoDigitYearField() {<a name="line.917"></a>
-<FONT color="green">918</FONT>                super();<a name="line.918"></a>
-<FONT color="green">919</FONT>            }<a name="line.919"></a>
-<FONT color="green">920</FONT>    <a name="line.920"></a>
-<FONT color="green">921</FONT>            /**<a name="line.921"></a>
-<FONT color="green">922</FONT>             * {@inheritDoc}<a name="line.922"></a>
-<FONT color="green">923</FONT>             */<a name="line.923"></a>
-<FONT color="green">924</FONT>            @Override<a name="line.924"></a>
-<FONT color="green">925</FONT>            public int estimateLength() {<a name="line.925"></a>
-<FONT color="green">926</FONT>                return 2;<a name="line.926"></a>
-<FONT color="green">927</FONT>            }<a name="line.927"></a>
-<FONT color="green">928</FONT>    <a name="line.928"></a>
-<FONT color="green">929</FONT>            /**<a name="line.929"></a>
-<FONT color="green">930</FONT>             * {@inheritDoc}<a name="line.930"></a>
-<FONT color="green">931</FONT>             */<a name="line.931"></a>
-<FONT color="green">932</FONT>            @Override<a name="line.932"></a>
-<FONT color="green">933</FONT>            public void appendTo(final StringBuffer buffer, final Calendar calendar) {<a name="line.933"></a>
-<FONT color="green">934</FONT>                appendTo(buffer, calendar.get(Calendar.YEAR) % 100);<a name="line.934"></a>
-<FONT color="green">935</FONT>            }<a name="line.935"></a>
-<FONT color="green">936</FONT>    <a name="line.936"></a>
-<FONT color="green">937</FONT>            /**<a name="line.937"></a>
-<FONT color="green">938</FONT>             * {@inheritDoc}<a name="line.938"></a>
-<FONT color="green">939</FONT>             */<a name="line.939"></a>
-<FONT color="green">940</FONT>            @Override<a name="line.940"></a>
-<FONT color="green">941</FONT>            public final void appendTo(final StringBuffer buffer, final int value) {<a name="line.941"></a>
-<FONT color="green">942</FONT>                buffer.append((char)(value / 10 + '0'));<a name="line.942"></a>
-<FONT color="green">943</FONT>                buffer.append((char)(value % 10 + '0'));<a name="line.943"></a>
+<FONT color="green">879</FONT>             * Constructs an instance of {@code TwoDigitNumberField} with the specified field.<a name="line.879"></a>
+<FONT color="green">880</FONT>             *<a name="line.880"></a>
+<FONT color="green">881</FONT>             * @param field the field<a name="line.881"></a>
+<FONT color="green">882</FONT>             */<a name="line.882"></a>
+<FONT color="green">883</FONT>            TwoDigitNumberField(final int field) {<a name="line.883"></a>
+<FONT color="green">884</FONT>                mField = field;<a name="line.884"></a>
+<FONT color="green">885</FONT>            }<a name="line.885"></a>
+<FONT color="green">886</FONT>    <a name="line.886"></a>
+<FONT color="green">887</FONT>            /**<a name="line.887"></a>
+<FONT color="green">888</FONT>             * {@inheritDoc}<a name="line.888"></a>
+<FONT color="green">889</FONT>             */<a name="line.889"></a>
+<FONT color="green">890</FONT>            @Override<a name="line.890"></a>
+<FONT color="green">891</FONT>            public int estimateLength() {<a name="line.891"></a>
+<FONT color="green">892</FONT>                return 2;<a name="line.892"></a>
+<FONT color="green">893</FONT>            }<a name="line.893"></a>
+<FONT color="green">894</FONT>    <a name="line.894"></a>
+<FONT color="green">895</FONT>            /**<a name="line.895"></a>
+<FONT color="green">896</FONT>             * {@inheritDoc}<a name="line.896"></a>

[... 688 lines stripped ...]


Mime
View raw message