001: /*
002: * Copyright 2001-2005 Stephen Colebourne
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.joda.time;
017:
018: /**
019: * DateTimeConstants is a non-instantiable class of constants used in
020: * the date time system. These are the ISO8601 constants, but should be
021: * used by all chronologies.
022: * <p>
023: * DateTimeConstants is thread-safe and immutable.
024: *
025: * @author Stephen Colebourne
026: * @author Brian S O'Neill
027: * @since 1.0
028: */
029: public class DateTimeConstants {
030:
031: // These are ints not enumerations as they represent genuine int values
032: /** Constant (1) representing January, the first month (ISO) */
033: public static final int JANUARY = 1;
034:
035: /** Constant (2) representing February, the second month (ISO) */
036: public static final int FEBRUARY = 2;
037:
038: /** Constant (3) representing March, the third month (ISO) */
039: public static final int MARCH = 3;
040:
041: /** Constant (4) representing April, the fourth month (ISO) */
042: public static final int APRIL = 4;
043:
044: /** Constant (5) representing May, the fifth month (ISO) */
045: public static final int MAY = 5;
046:
047: /** Constant (6) representing June, the sixth month (ISO) */
048: public static final int JUNE = 6;
049:
050: /** Constant (7) representing July, the seventh month (ISO) */
051: public static final int JULY = 7;
052:
053: /** Constant (8) representing August, the eighth month (ISO) */
054: public static final int AUGUST = 8;
055:
056: /** Constant (9) representing September, the nineth month (ISO) */
057: public static final int SEPTEMBER = 9;
058:
059: /** Constant (10) representing October, the tenth month (ISO) */
060: public static final int OCTOBER = 10;
061:
062: /** Constant (11) representing November, the eleventh month (ISO) */
063: public static final int NOVEMBER = 11;
064:
065: /** Constant (12) representing December, the twelfth month (ISO) */
066: public static final int DECEMBER = 12;
067:
068: // These are ints not enumerations as they represent genuine int values
069: /** Constant (1) representing Monday, the first day of the week (ISO) */
070: public static final int MONDAY = 1;
071:
072: /** Constant (2) representing Tuesday, the second day of the week (ISO) */
073: public static final int TUESDAY = 2;
074:
075: /** Constant (3) representing Wednesday, the third day of the week (ISO) */
076: public static final int WEDNESDAY = 3;
077:
078: /** Constant (4) representing Thursday, the fourth day of the week (ISO) */
079: public static final int THURSDAY = 4;
080:
081: /** Constant (5) representing Friday, the fifth day of the week (ISO) */
082: public static final int FRIDAY = 5;
083:
084: /** Constant (6) representing Saturday, the sixth day of the week (ISO) */
085: public static final int SATURDAY = 6;
086:
087: /** Constant (7) representing Sunday, the seventh day of the week (ISO) */
088: public static final int SUNDAY = 7;
089:
090: /** Constant (0) representing AM, the morning (from Calendar) */
091: public static final int AM = 0;
092:
093: /** Constant (1) representing PM, the afternoon (from Calendar) */
094: public static final int PM = 1;
095:
096: /** Constant (0) representing BC, years before zero (from Calendar) */
097: public static final int BC = 0;
098: /** Alternative constant (0) representing BCE, Before Common Era (secular) */
099: public static final int BCE = 0;
100:
101: /**
102: * Constant (1) representing AD, years after zero (from Calendar).
103: * <p>
104: * All new chronologies with differrent Era values should try to assign
105: * eras as follows. The era that was in force at 1970-01-01 (ISO) is assigned
106: * the value 1. Earlier eras are assigned sequentially smaller numbers.
107: * Later eras are assigned sequentially greater numbers.
108: */
109: public static final int AD = 1;
110: /**
111: * Alternative constant (1) representing CE, Common Era (secular).
112: * <p>
113: * All new chronologies with differrent Era values should try to assign
114: * eras as follows. The era that was in force at 1970-01-01 (ISO) is assigned
115: * the value 1. Earlier eras are assigned sequentially smaller numbers.
116: * Later eras are assigned sequentially greater numbers.
117: */
118: public static final int CE = 1;
119:
120: /** Milliseconds in one second (1000) (ISO) */
121: public static final int MILLIS_PER_SECOND = 1000;
122:
123: /** Seconds in one minute (60) (ISO) */
124: public static final int SECONDS_PER_MINUTE = 60;
125: /** Milliseconds in one minute (ISO) */
126: public static final int MILLIS_PER_MINUTE = MILLIS_PER_SECOND
127: * SECONDS_PER_MINUTE;
128:
129: /** Minutes in one hour (ISO) */
130: public static final int MINUTES_PER_HOUR = 60;
131: /** Seconds in one hour (ISO) */
132: public static final int SECONDS_PER_HOUR = SECONDS_PER_MINUTE
133: * MINUTES_PER_HOUR;
134: /** Milliseconds in one hour (ISO) */
135: public static final int MILLIS_PER_HOUR = MILLIS_PER_MINUTE
136: * MINUTES_PER_HOUR;
137:
138: /** Hours in a typical day (24) (ISO). Due to time zone offset changes, the
139: * number of hours per day can vary. */
140: public static final int HOURS_PER_DAY = 24;
141: /** Minutes in a typical day (ISO). Due to time zone offset changes, the number
142: * of minutes per day can vary. */
143: public static final int MINUTES_PER_DAY = MINUTES_PER_HOUR
144: * HOURS_PER_DAY;
145: /** Seconds in a typical day (ISO). Due to time zone offset changes, the number
146: * of seconds per day can vary. */
147: public static final int SECONDS_PER_DAY = SECONDS_PER_HOUR
148: * HOURS_PER_DAY;
149: /** Milliseconds in a typical day (ISO). Due to time zone offset changes, the
150: * number of milliseconds per day can vary. */
151: public static final int MILLIS_PER_DAY = MILLIS_PER_HOUR
152: * HOURS_PER_DAY;
153:
154: /** Days in one week (7) (ISO) */
155: public static final int DAYS_PER_WEEK = 7;
156: /** Hours in a typical week. Due to time zone offset changes, the number of
157: * hours per week can vary. */
158: public static final int HOURS_PER_WEEK = HOURS_PER_DAY
159: * DAYS_PER_WEEK;
160: /** Minutes in a typical week (ISO). Due to time zone offset changes, the number
161: * of minutes per week can vary. */
162: public static final int MINUTES_PER_WEEK = MINUTES_PER_DAY
163: * DAYS_PER_WEEK;
164: /** Seconds in a typical week (ISO). Due to time zone offset changes, the number
165: * of seconds per week can vary. */
166: public static final int SECONDS_PER_WEEK = SECONDS_PER_DAY
167: * DAYS_PER_WEEK;
168: /** Milliseconds in a typical week (ISO). Due to time zone offset changes, the
169: * number of milliseconds per week can vary. */
170: public static final int MILLIS_PER_WEEK = MILLIS_PER_DAY
171: * DAYS_PER_WEEK;
172:
173: /**
174: * Restrictive constructor
175: */
176: protected DateTimeConstants() {
177: }
178:
179: }
|