01: /*
02: * Copyright 2001-2005 Stephen Colebourne
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.joda.time.chrono;
17:
18: import java.util.Locale;
19:
20: /**
21: * Provides time calculations for the month of the year component of time.
22: *
23: * @author Guy Allard
24: * @author Stephen Colebourne
25: * @author Brian S O'Neill
26: * @since 1.0
27: */
28: final class GJMonthOfYearDateTimeField extends
29: BasicMonthOfYearDateTimeField {
30:
31: /** Serialization version */
32: private static final long serialVersionUID = -4748157875845286249L;
33:
34: /**
35: * Restricted constructor
36: */
37: GJMonthOfYearDateTimeField(BasicChronology chronology) {
38: super (chronology, 2);
39: }
40:
41: //-----------------------------------------------------------------------
42: public String getAsText(int fieldValue, Locale locale) {
43: return GJLocaleSymbols.forLocale(locale)
44: .monthOfYearValueToText(fieldValue);
45: }
46:
47: //-----------------------------------------------------------------------
48: public String getAsShortText(int fieldValue, Locale locale) {
49: return GJLocaleSymbols.forLocale(locale)
50: .monthOfYearValueToShortText(fieldValue);
51: }
52:
53: //-----------------------------------------------------------------------
54: protected int convertText(String text, Locale locale) {
55: return GJLocaleSymbols.forLocale(locale)
56: .monthOfYearTextToValue(text);
57: }
58:
59: //-----------------------------------------------------------------------
60: public int getMaximumTextLength(Locale locale) {
61: return GJLocaleSymbols.forLocale(locale)
62: .getMonthMaxTextLength();
63: }
64:
65: //-----------------------------------------------------------------------
66: public int getMaximumShortTextLength(Locale locale) {
67: return GJLocaleSymbols.forLocale(locale)
68: .getMonthMaxShortTextLength();
69: }
70:
71: }
|