01: /*
02: * Copyright 2001-2007 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.base;
17:
18: /**
19: * BaseLocal is an abstract implementation of ReadablePartial that
20: * use a local milliseconds internal representation.
21: * <p>
22: * This class should generally not be used directly by API users.
23: * The {@link org.joda.time.ReadablePartial} interface should be used when different
24: * kinds of partial objects are to be referenced.
25: * <p>
26: * BasePartial subclasses may be mutable and not thread-safe.
27: *
28: * @author Stephen Colebourne
29: * @since 1.5
30: */
31: public abstract class BaseLocal extends AbstractPartial {
32:
33: /** Serialization version */
34: private static final long serialVersionUID = 276453175381783L;
35:
36: //-----------------------------------------------------------------------
37: /**
38: * Constructs a partial with the current time, using ISOChronology in
39: * the default zone to extract the fields.
40: * <p>
41: * The constructor uses the default time zone, resulting in the local time
42: * being initialised. Once the constructor is complete, all further calculations
43: * are performed without reference to a timezone (by switching to UTC).
44: */
45: protected BaseLocal() {
46: super ();
47: }
48:
49: //-----------------------------------------------------------------------
50: /**
51: * Gets the local milliseconds from the Java epoch
52: * of 1970-01-01T00:00:00 (not fixed to any specific time zone).
53: * <p>
54: * This method is useful in certain circustances for high performance
55: * access to the datetime fields.
56: *
57: * @return the number of milliseconds since 1970-01-01T00:00:00
58: */
59: protected abstract long getLocalMillis();
60:
61: }
|