@@ -97,10 +97,7 @@ public static final class DecayGeoLinear {
9797 double scaling ;
9898
9999 public DecayGeoLinear (String originStr , String scaleStr , String offsetStr , double decay ) {
100- this (GeoUtils .parseGeoPoint (originStr , false ), scaleStr , offsetStr , decay );
101- }
102-
103- public DecayGeoLinear (GeoPoint origin , String scaleStr , String offsetStr , double decay ) {
100+ GeoPoint origin = GeoUtils .parseGeoPoint (originStr , false );
104101 double scale = DistanceUnit .DEFAULT .parse (scaleStr , DistanceUnit .DEFAULT );
105102 this .originLat = origin .lat ();
106103 this .originLon = origin .lon ();
@@ -122,10 +119,7 @@ public static final class DecayGeoExp {
122119 double scaling ;
123120
124121 public DecayGeoExp (String originStr , String scaleStr , String offsetStr , double decay ) {
125- this (GeoUtils .parseGeoPoint (originStr , false ), scaleStr , offsetStr , decay );
126- }
127-
128- public DecayGeoExp (GeoPoint origin , String scaleStr , String offsetStr , double decay ) {
122+ GeoPoint origin = GeoUtils .parseGeoPoint (originStr , false );
129123 double scale = DistanceUnit .DEFAULT .parse (scaleStr , DistanceUnit .DEFAULT );
130124 this .originLat = origin .lat ();
131125 this .originLon = origin .lon ();
@@ -147,10 +141,7 @@ public static final class DecayGeoGauss {
147141 double scaling ;
148142
149143 public DecayGeoGauss (String originStr , String scaleStr , String offsetStr , double decay ) {
150- this (GeoUtils .parseGeoPoint (originStr , false ), scaleStr , offsetStr , decay );
151- }
152-
153- public DecayGeoGauss (GeoPoint origin , String scaleStr , String offsetStr , double decay ) {
144+ GeoPoint origin = GeoUtils .parseGeoPoint (originStr , false );
154145 double scale = DistanceUnit .DEFAULT .parse (scaleStr , DistanceUnit .DEFAULT );
155146 this .originLat = origin .lat ();
156147 this .originLon = origin .lon ();
@@ -243,13 +234,6 @@ public DecayDateLinear(String originStr, String scaleStr, String offsetStr, doub
243234 this .scaling = scale / (1.0 - decay );
244235 }
245236
246- public DecayDateLinear (long origin , TemporalAmount scale , TemporalAmount offset , double decay ) {
247- this .origin = origin ;
248- long scaleMillis = temporalAmountToMillis (scale );
249- this .offset = temporalAmountToMillis (offset );
250- this .scaling = scaleMillis / (1.0 - decay );
251- }
252-
253237 public double decayDateLinear (ZonedDateTime docValueDate ) {
254238 long docValue = docValueDate .toInstant ().toEpochMilli ();
255239 // as java.lang.Math#abs(long) is a forbidden API, have to use this comparison instead
@@ -273,13 +257,6 @@ public DecayDateExp(String originStr, String scaleStr, String offsetStr, double
273257 this .scaling = Math .log (decay ) / scale ;
274258 }
275259
276- public DecayDateExp (long origin , TemporalAmount scale , TemporalAmount offset , double decay ) {
277- this .origin = origin ;
278- long scaleMillis = temporalAmountToMillis (scale );
279- this .offset = temporalAmountToMillis (offset );
280- this .scaling = Math .log (decay ) / scaleMillis ;
281- }
282-
283260 public double decayDateExp (ZonedDateTime docValueDate ) {
284261 long docValue = docValueDate .toInstant ().toEpochMilli ();
285262 long diff = (docValue >= origin ) ? (docValue - origin ) : (origin - docValue );
@@ -302,13 +279,6 @@ public DecayDateGauss(String originStr, String scaleStr, String offsetStr, doubl
302279 this .scaling = 0.5 * Math .pow (scale , 2.0 ) / Math .log (decay );
303280 }
304281
305- public DecayDateGauss (long origin , TemporalAmount scale , TemporalAmount offset , double decay ) {
306- this .origin = origin ;
307- long scaleMillis = temporalAmountToMillis (scale );
308- this .offset = temporalAmountToMillis (offset );
309- this .scaling = 0.5 * Math .pow (scaleMillis , 2.0 ) / Math .log (decay );
310- }
311-
312282 public double decayDateGauss (ZonedDateTime docValueDate ) {
313283 long docValue = docValueDate .toInstant ().toEpochMilli ();
314284 long diff = (docValue >= origin ) ? (docValue - origin ) : (origin - docValue );
0 commit comments