mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.xtns.mapSources; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.xowa.langs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
|
||||
public class Map_dd2dms_func extends Pf_func_base {
|
||||
@Override public int Id() {return Xol_kwd_grp_.Id_mapSources_dd2dms;}
|
||||
@@ -43,21 +43,21 @@ public class Map_dd2dms_func extends Pf_func_base {
|
||||
}
|
||||
}
|
||||
tmp_bfr.Mkr_rls();
|
||||
Map_math map_math = Map_math._;
|
||||
Map_math map_math = Map_math.Instance;
|
||||
if (map_math.Ctor(coord, prec, Bry_.Empty, 2))
|
||||
bfr.Add(map_math.Get_dms(plus, minus));
|
||||
else
|
||||
map_math.Fail(ctx, src, self, bfr, this.Name());
|
||||
}
|
||||
public static void Deg_to_dms(Bry_bfr bfr, boolean coord_is_lng, byte[] coord, int prec) {
|
||||
Map_math map_math = Map_math._;
|
||||
Map_math map_math = Map_math.Instance;
|
||||
if (map_math.Ctor(coord, prec, Bry_.Empty, 2)) {
|
||||
bfr.Add(map_math.Get_dms(Bry_.Empty, Bry_.Empty));
|
||||
byte[] dir = coord_is_lng ? map_math.Coord_dir_ns() : map_math.Coord_dir_ew();
|
||||
bfr.Add_byte_space().Add(dir);
|
||||
}
|
||||
}
|
||||
public static final Map_dd2dms_func _ = new Map_dd2dms_func(); Map_dd2dms_func() {}
|
||||
public static final Map_dd2dms_func Instance = new Map_dd2dms_func(); Map_dd2dms_func() {}
|
||||
private static final byte Key_tid_plus = 1, Key_tid_minus = 2, Key_tid_precision = 3;
|
||||
private static final Hash_adp_bry Key_hash = Hash_adp_bry.cs()
|
||||
.Add_str_byte("plus" , Key_tid_plus)
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.mapSources; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.xowa.langs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
|
||||
public class Map_deg2dd_func extends Pf_func_base {
|
||||
@Override public int Id() {return Xol_kwd_grp_.Id_mapSources_deg2dd;}
|
||||
@@ -26,11 +26,11 @@ public class Map_deg2dd_func extends Pf_func_base {
|
||||
byte[] coord = Eval_argx(ctx, src, caller, self);
|
||||
byte[] precision_bry = Pf_func_.Eval_val_or(ctx, src, caller, self, self.Args_len(), 0, null);
|
||||
int prec = precision_bry == null ? -1 : Bry_.To_int_or(precision_bry, -1);
|
||||
Map_math map_math = Map_math._;
|
||||
Map_math map_math = Map_math.Instance;
|
||||
if (map_math.Ctor(coord, prec, Bry_.Empty, 2))
|
||||
bfr.Add_double(map_math.Coord_dec());
|
||||
else
|
||||
map_math.Fail(ctx, src, self, bfr, this.Name());
|
||||
}
|
||||
public static final Map_deg2dd_func _ = new Map_deg2dd_func(); Map_deg2dd_func() {}
|
||||
public static final Map_deg2dd_func Instance = new Map_deg2dd_func(); Map_deg2dd_func() {}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.xtns.mapSources; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import gplx.core.primitives.*;
|
||||
import gplx.xowa.langs.*;
|
||||
import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*; import gplx.xowa.langs.kwds.*;
|
||||
import gplx.xowa.xtns.pfuncs.*;
|
||||
import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*;
|
||||
public class Map_geolink_func extends Pf_func_base {
|
||||
@@ -66,7 +66,7 @@ public class Map_geolink_func extends Pf_func_base {
|
||||
private static final Xol_msg_itm tmp_msg_itm = new Xol_msg_itm(-1, Bry_.Empty);
|
||||
private static byte[] Xto_coord(Bry_bfr bfr, Map_math math, boolean pass, byte[] dir, byte[] or) {
|
||||
return pass
|
||||
? bfr.Add_double(Math_.Abs_double(math.Dec())).Add_byte(Byte_ascii.Underline).Add(dir).Xto_bry_and_clear()
|
||||
? bfr.Add_double(Math_.Abs_double(math.Dec())).Add_byte(Byte_ascii.Underline).Add(dir).To_bry_and_clear()
|
||||
: or
|
||||
;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class Map_geolink_func extends Pf_func_base {
|
||||
}
|
||||
private static byte[] Xto_dec(Bry_bfr bfr, Map_math math, boolean pass) {
|
||||
return pass
|
||||
? bfr.Add_double(math.Dec()).Xto_bry_and_clear()
|
||||
? bfr.Add_double(math.Dec()).To_bry_and_clear()
|
||||
: Bry_arg_5_fail
|
||||
;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class Map_geolink_func extends Pf_func_base {
|
||||
/*
|
||||
return wfMsgReplaceArgs( $pattern, $args );
|
||||
*/
|
||||
public static final Map_geolink_func _ = new Map_geolink_func(); Map_geolink_func() {}
|
||||
public static final Map_geolink_func Instance = new Map_geolink_func(); Map_geolink_func() {}
|
||||
private static final byte Key_tid_lat_val = 1, Key_tid_long_val = 2, Key_tid_lat_pos = 3, Key_tid_lat_neg = 4, Key_tid_long_pos = 5, Key_tid_long_min = 6, Key_tid_prec = 7;
|
||||
private static final Hash_adp_bry Key_hash = Hash_adp_bry.cs()
|
||||
.Add_str_byte("lat" , Key_tid_lat_val)
|
||||
|
||||
@@ -136,7 +136,7 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
letter = minus;
|
||||
if (letter != null)
|
||||
tmp_bfr.Add_byte_space().Add(letter);
|
||||
return tmp_bfr.Xto_bry_and_clear();
|
||||
return tmp_bfr.To_bry_and_clear();
|
||||
}
|
||||
private void Parse_input(byte[] src) { // REF.MW: toDec
|
||||
src = Parse_input_normalize(tmp_bfr, src);
|
||||
@@ -268,7 +268,7 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
i = Input_trie.Match_pos();
|
||||
}
|
||||
}
|
||||
return bfr.Xto_bry_and_clear_and_trim();
|
||||
return bfr.To_bry_and_clear_and_trim();
|
||||
}
|
||||
private static final byte Dir_unknown_id = 0, Dir_lat_id = 1, Dir_long_id = 2;
|
||||
public static final byte[] Dir_lat_bry = Bry_.new_a7("lat"), Dir_long_bry = Bry_.new_a7("long");
|
||||
@@ -315,5 +315,5 @@ class Map_math {// REF.MW:MapSources_math.php
|
||||
.Add_str_byte("e" , Input_tid_compass)
|
||||
.Add_str_byte("w" , Input_tid_compass)
|
||||
;
|
||||
public static final Map_math _ = new Map_math();
|
||||
public static final Map_math Instance = new Map_math();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user