< prev index next >

src/java.base/share/classes/java/util/Calendar.java

Print this page




 827     public static final int LONG_STANDALONE = LONG | STANDALONE_MASK;
 828 
 829     // Internal notes:
 830     // Calendar contains two kinds of time representations: current "time" in
 831     // milliseconds, and a set of calendar "fields" representing the current time.
 832     // The two representations are usually in sync, but can get out of sync
 833     // as follows.
 834     // 1. Initially, no fields are set, and the time is invalid.
 835     // 2. If the time is set, all fields are computed and in sync.
 836     // 3. If a single field is set, the time is invalid.
 837     // Recomputation of the time and fields happens when the object needs
 838     // to return a result to the user, or use a result for a computation.
 839 
 840     /**
 841      * The calendar field values for the currently set time for this calendar.
 842      * This is an array of <code>FIELD_COUNT</code> integers, with index values
 843      * <code>ERA</code> through <code>DST_OFFSET</code>.
 844      * @serial
 845      */
 846     @SuppressWarnings("ProtectedField")
 847     protected int           fields[];
 848 
 849     /**
 850      * The flags which tell if a specified calendar field for the calendar is set.
 851      * A new object has no fields set.  After the first call to a method
 852      * which generates the fields, they all remain set after that.
 853      * This is an array of <code>FIELD_COUNT</code> booleans, with index values
 854      * <code>ERA</code> through <code>DST_OFFSET</code>.
 855      * @serial
 856      */
 857     @SuppressWarnings("ProtectedField")
 858     protected boolean       isSet[];
 859 
 860     /**
 861      * Pseudo-time-stamps which specify when each field was set. There
 862      * are two special values, UNSET and COMPUTED. Values from
 863      * MINIMUM_USER_SET to Integer.MAX_VALUE are legal user set values.
 864      */
 865     private transient int   stamp[];
 866 
 867     /**
 868      * The currently set time for this calendar, expressed in milliseconds after
 869      * January 1, 1970, 0:00:00 GMT.
 870      * @see #isTimeSet
 871      * @serial
 872      */
 873     @SuppressWarnings("ProtectedField")
 874     protected long          time;
 875 
 876     /**
 877      * True if then the value of <code>time</code> is valid.
 878      * The time is made invalid by a change to an item of <code>field[]</code>.
 879      * @see #time
 880      * @serial
 881      */
 882     @SuppressWarnings("ProtectedField")
 883     protected boolean       isTimeSet;
 884 
 885     /**




 827     public static final int LONG_STANDALONE = LONG | STANDALONE_MASK;
 828 
 829     // Internal notes:
 830     // Calendar contains two kinds of time representations: current "time" in
 831     // milliseconds, and a set of calendar "fields" representing the current time.
 832     // The two representations are usually in sync, but can get out of sync
 833     // as follows.
 834     // 1. Initially, no fields are set, and the time is invalid.
 835     // 2. If the time is set, all fields are computed and in sync.
 836     // 3. If a single field is set, the time is invalid.
 837     // Recomputation of the time and fields happens when the object needs
 838     // to return a result to the user, or use a result for a computation.
 839 
 840     /**
 841      * The calendar field values for the currently set time for this calendar.
 842      * This is an array of <code>FIELD_COUNT</code> integers, with index values
 843      * <code>ERA</code> through <code>DST_OFFSET</code>.
 844      * @serial
 845      */
 846     @SuppressWarnings("ProtectedField")
 847     protected int[]           fields;
 848 
 849     /**
 850      * The flags which tell if a specified calendar field for the calendar is set.
 851      * A new object has no fields set.  After the first call to a method
 852      * which generates the fields, they all remain set after that.
 853      * This is an array of <code>FIELD_COUNT</code> booleans, with index values
 854      * <code>ERA</code> through <code>DST_OFFSET</code>.
 855      * @serial
 856      */
 857     @SuppressWarnings("ProtectedField")
 858     protected boolean[]       isSet;
 859 
 860     /**
 861      * Pseudo-time-stamps which specify when each field was set. There
 862      * are two special values, UNSET and COMPUTED. Values from
 863      * MINIMUM_USER_SET to Integer.MAX_VALUE are legal user set values.
 864      */
 865     private transient int[]   stamp;
 866 
 867     /**
 868      * The currently set time for this calendar, expressed in milliseconds after
 869      * January 1, 1970, 0:00:00 GMT.
 870      * @see #isTimeSet
 871      * @serial
 872      */
 873     @SuppressWarnings("ProtectedField")
 874     protected long          time;
 875 
 876     /**
 877      * True if then the value of <code>time</code> is valid.
 878      * The time is made invalid by a change to an item of <code>field[]</code>.
 879      * @see #time
 880      * @serial
 881      */
 882     @SuppressWarnings("ProtectedField")
 883     protected boolean       isTimeSet;
 884 
 885     /**


< prev index next >