1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.joda.time;
17
18 public class MockZone extends DateTimeZone {
19
20 long transition;
21 int winterOffset;
22
23 public MockZone(long transition, int winterOffset) {
24 super("MockZone");
25 this.transition = transition;
26 this.winterOffset = winterOffset;
27 }
28
29 public int getOffset(long instant) {
30 return (instant < transition ? winterOffset : winterOffset + 3600000);
31 }
32
33 public int getStandardOffset(long instant) {
34 return winterOffset;
35 }
36
37 public long nextTransition(long instant) {
38 return (instant < transition ? transition : transition + 180L * DateTimeConstants.MILLIS_PER_DAY);
39 }
40
41 public long previousTransition(long instant) {
42 return (instant > transition ? transition : transition - 180L * DateTimeConstants.MILLIS_PER_DAY);
43 }
44
45 public boolean isFixed() {
46 return false;
47 }
48
49 public String getNameKey(long instant) {
50 return null;
51 }
52
53 public boolean equals(Object object) {
54 return false;
55 }
56 }