Subversion Repository Public Repository

litesoft

Diff Revisions 911 vs 912 for /trunk/Java/core/Anywhere/src/org/litesoft/core/simpletypes/temporal/AbstractTimestampHM.java

Diff revisions: vs.
  @@ -7,25 +7,18 @@
7 7 {
8 8 private static final long serialVersionUID = 1L;
9 9
10 - protected AbstractTimestampHM( int pOriginalZuluOffsetMins, long pUTC )
11 - {
12 - super( pOriginalZuluOffsetMins, pUTC );
13 - }
14 -
15 - protected AbstractTimestampHM( int pOriginalZuluOffsetMins, UtilDateAdaptor pDateAdaptor )
16 - {
17 - super( pOriginalZuluOffsetMins, pDateAdaptor );
18 - }
10 + private final int mMin;
19 11
20 - protected AbstractTimestampHM( UtilDateAdaptor pDateAdaptor )
12 + protected AbstractTimestampHM( int pYear, int pMonth, int pDay, int pZuluOffsetMins, int pHour, int pMin )
21 13 {
22 - super( pDateAdaptor );
14 + super( pYear, pMonth, pDay, pZuluOffsetMins, pHour );
15 + mMin = validateMin( pMin );
23 16 }
24 17
25 18 @Override
26 19 public final int getMin()
27 20 {
28 - return getWall().getMin();
21 + return mMin;
29 22 }
30 23
31 24 /**
  @@ -34,7 +27,7 @@
34 27 public final T min( int pMin )
35 28 {
36 29 validateMin( pMin );
37 - return (getMin() == pMin) ? us() : LLsetMin( pMin );
30 + return (mMin == pMin) ? us() : LLsetMin( pMin );
38 31 }
39 32
40 33 /**
  @@ -42,7 +35,7 @@
42 35 */
43 36 public final T addMins( int pMins )
44 37 {
45 - return (pMins == 0) ? us() : LLsetMin( getMin() + pMins );
38 + return (pMins == 0) ? us() : LLsetMin( mMin + pMins );
46 39 }
47 40
48 41 /**
  @@ -50,7 +43,7 @@
50 43 */
51 44 public final T minusMins( int pMins )
52 45 {
53 - return (pMins == 0) ? us() : LLsetMin( getMin() - pMins );
46 + return (pMins == 0) ? us() : LLsetMin( mMin - pMins );
54 47 }
55 48
56 49 // vvvvvvvvvvvvvvvvvv Support methods vvvvvvvvvvvvvvvvv
  @@ -91,7 +84,7 @@
91 84
92 85 protected int LL_hashCode()
93 86 {
94 - return hashCodeEm( super.hashCode(), getMin() );
87 + return hashCodeEm( super.hashCode(), mMin );
95 88 }
96 89
97 90 /**
  @@ -113,7 +106,7 @@
113 106 }
114 107
115 108 /**
116 - * @param pNewMin != current
109 + * @param pNewMonth != current
117 110 */
118 111 protected final T LLsetMin( int pNewMin )
119 112 {
  @@ -124,13 +117,13 @@
124 117
125 118 protected abstract M createMutable( int pYear, int pMonth, int pDay, int pHour, int pNewMin );
126 119
127 - protected static class Mutable extends AbstractTimestampH.Mutable
120 + protected static class Mutable extends AbstractTimestampH.Mutable implements TimestampAccessorHM
128 121 {
129 122 protected int mMin;
130 123
131 - public Mutable( int pYear, int pMonth, int pDay, boolean pDayConstrained, int pHour, int pMin )
124 + public Mutable( int pYear, int pMonth, int pDay, boolean pDayConstrained, int pZuluOffsetMins, int pHour, int pMin )
132 125 {
133 - super( pYear, pMonth, pDay, pDayConstrained, pHour );
126 + super( pYear, pMonth, pDay, pDayConstrained, pZuluOffsetMins, pHour );
134 127 mMin = pMin;
135 128 }
136 129
  @@ -181,11 +174,11 @@
181 174 }
182 175
183 176 @Override
184 - public final void adjustOrigWallToZulu( int pOffsetMinsAdjustment )
177 + protected final void adjustMinutesTo( int pOffsetMinsAdjustment )
185 178 {
186 179 if ( pOffsetMinsAdjustment != 0 )
187 180 {
188 - mMin -= pOffsetMinsAdjustment;
181 + mMin += pOffsetMinsAdjustment;
189 182 normalize();
190 183 }
191 184 }