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 int sizeMillis;
23
24 public MockZone(long transition, int winterOffset, int sizeSecs) {
25 super("MockZone");
26 this.transition = transition;
27 this.winterOffset = winterOffset;
28 this.sizeMillis = sizeSecs * 1000;
29 }
30
31 public int getOffset(long instant) {
32 return (instant < transition ? winterOffset : winterOffset + sizeMillis);
33 }
34
35 public int getStandardOffset(long instant) {
36 return winterOffset;
37 }
38
39 public long nextTransition(long instant) {
40 return (instant < transition ? transition : transition + 180L * DateTimeConstants.MILLIS_PER_DAY);
41 }
42
43 public long previousTransition(long instant) {
44 return (instant > transition ? transition : transition - 180L * DateTimeConstants.MILLIS_PER_DAY);
45 }
46
47 public boolean isFixed() {
48 return false;
49 }
50
51 public String getNameKey(long instant) {
52 return null;
53 }
54
55 public boolean equals(Object object) {
56 return false;
57 }
58 }