001    /*
002     *  Copyright 2001-2007 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.base;
017    
018    /**
019     * BaseLocal is an abstract implementation of ReadablePartial that
020     * use a local milliseconds internal representation.
021     * <p>
022     * This class should generally not be used directly by API users.
023     * The {@link org.joda.time.ReadablePartial} interface should be used when different 
024     * kinds of partial objects are to be referenced.
025     * <p>
026     * BasePartial subclasses may be mutable and not thread-safe.
027     *
028     * @author Stephen Colebourne
029     * @since 1.5
030     */
031    public abstract class BaseLocal
032            extends AbstractPartial {
033    
034        /** Serialization version */
035        private static final long serialVersionUID = 276453175381783L;
036    
037        //-----------------------------------------------------------------------
038        /**
039         * Constructs a partial with the current time, using ISOChronology in
040         * the default zone to extract the fields.
041         * <p>
042         * The constructor uses the default time zone, resulting in the local time
043         * being initialised. Once the constructor is complete, all further calculations
044         * are performed without reference to a timezone (by switching to UTC).
045         */
046        protected BaseLocal() {
047            super();
048        }
049    
050        //-----------------------------------------------------------------------
051        /**
052         * Gets the local milliseconds from the Java epoch
053         * of 1970-01-01T00:00:00 (not fixed to any specific time zone).
054         * <p>
055         * This method is useful in certain circustances for high performance
056         * access to the datetime fields.
057         * 
058         * @return the number of milliseconds since 1970-01-01T00:00:00
059         */
060        protected abstract long getLocalMillis();
061    
062    }