View Javadoc

1   /*
2    *  Copyright 2001-2005 Stephen Colebourne
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
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.convert;
17  
18  import java.util.Calendar;
19  import java.util.TimeZone;
20  
21  /**
22   * A basic mock testing class for an unknown calendar.
23   *
24   * @author Stephen Colebourne
25   */
26  class MockUnknownCalendar extends Calendar {
27      
28      private long millis;
29      private TimeZone zone;
30      
31      MockUnknownCalendar(long millis) {
32          this.millis = millis;
33      }
34      MockUnknownCalendar(TimeZone zone) {
35          this.zone = zone;
36      }
37      
38      public long getTimeInMillis() {
39          return millis;
40      }
41      public TimeZone getTimeZone() {
42          return zone;
43      }
44  
45      protected void computeTime() {
46      }
47      protected void computeFields() {
48      }
49      public void add(int field, int amount) {
50      }
51      public void roll(int field, boolean up) {
52      }
53      public int getMinimum(int field) {
54          return 0;
55      }
56      public int getMaximum(int field) {
57          return 0;
58      }
59      public int getGreatestMinimum(int field) {
60          return 0;
61      }
62      public int getLeastMaximum(int field) {
63          return 0;
64      }
65  
66  }