Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.timesupport / org.gvsig.timesupport.lib / org.gvsig.timesupport.lib.api / src / main / java / org / gvsig / timesupport / Chronology.java @ 42003

History | View | Annotate | Download (3.16 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.timesupport;
23

    
24

    
25
/**
26
 * <p>
27
 * Chronology provides access to the individual date time fields for a
28
 * chronological calendar system.
29
 * </p> 
30
 *  <p>
31
 * Various chronologies are supported by subclasses including ISO
32
 * and GregorianJulian. To construct a Chronology you should use the
33
 * factory methods on the {@link TimeSupportManager}.
34
 * <p>
35
 * The provided chronology implementations are:
36
 * <ul>
37
 * <li>ISO - Based on the ISO8601 standard and suitable for use after about 1600
38
 * <li>GJ - Historically accurate calendar with Julian followed by Gregorian
39
 * <li>Gregorian - The Gregorian calendar system used for all time (proleptic)
40
 * <li>Julian - The Julian calendar system used for all time (proleptic)
41
 * <li>Buddhist - The Buddhist calendar system which is an offset in years from GJ
42
 * <li>Coptic - The Coptic calendar system which defines 30 day months
43
 * <li>Ethiopic - The Ethiopic calendar system which defines 30 day months
44
 * </ul>
45
 * </p>
46
 * <p>
47
 * Instances of this class are singletons and they can be compared using the
48
 * {@link Chronology}{@link #getType()} method and the <code>==</code>
49
 * operator.
50
 * </p>
51
 * <p>
52
 * A huge part of the documentation of this class has been retrieved
53
 * from the joda-time library.
54
 * </p>
55
 * 
56
 * @see http://joda-time.sourceforge.net
57
 * @see https://gvsig.org/web/projects/gvsig-desktop/docs/devel/org-gvsig-sensors/1-0.0/analysis-and-design/detailed-view/time-support/libraries/org-gvsig-timesupport-lib
58
 * 
59
 * @author gvSIG Team
60
 * @version $Id$
61
 *
62
 */
63
public interface Chronology {
64
    public static final int BUDDHIST = 1;
65
    public static final int COPTIC = 2;
66
    public static final int GJ = 3;
67
    public static final int GREGORIAN = 4;
68
    public static final int ISO = 5;
69
    public static final int JULIAN = 6;
70

    
71
    /**
72
     * Gets the code of the type, that is one of the constants defined
73
     * in the {@link Chronology} class.
74
     * @return
75
     *            the type code
76
     */
77
    public int getType();    
78
    
79
    /**
80
     * Returns an instance of this Chronology that operates in the UTC time
81
     * zone. Chronologies that do not operate in a time zone or are already
82
     * UTC must return themself.
83
     * @return 
84
     *          a version of this chronology that ignores time zones
85
     */
86
    public Chronology withUTC();
87
}