1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Core: Refactor base classes

This commit is contained in:
gnosygnu
2016-11-28 08:28:00 -05:00
parent 12459429b4
commit 83cf992f48
60 changed files with 172 additions and 343 deletions

View File

@@ -174,7 +174,7 @@ public class Scrib_lib_language implements Scrib_lib {
if (kv_ary != null) {
Object skip_commafy_obj = Keyval_.Ary_get_by_key_or_null(kv_ary, "noCommafy");
if (skip_commafy_obj != null)
skip_commafy = Bool_.cast(skip_commafy_obj);
skip_commafy = Bool_.Cast(skip_commafy_obj);
}
}
byte[] rv = lang.Num_mgr().Format_num(num, skip_commafy);

View File

@@ -81,7 +81,7 @@ class Scrib_lib_message_data {
break;
case Key_tid_rawMessage: raw_msg_key = kv.Val_to_bry(); break;
case Key_tid_lang: lang_key = kv.Val_to_bry(); break;
case Key_tid_useDB: use_db = Bool_.cast(kv.Val()); break;
case Key_tid_useDB: use_db = Bool_.Cast(kv.Val()); break;
case Key_tid_title: title_bry = kv.Val_to_bry(); break;
case Key_tid_params:
Keyval[] args_ary = (Keyval[])kv.Val();

View File

@@ -178,7 +178,7 @@ class Scrib_lib_text__json_util {
else if (Type_adp_.Eq(type, Long_.Cls_ref_type)) wtr.Kv_long(kv.Key(), Long_.cast(kv_val));
else if (Type_adp_.Eq(type, Float_.Cls_ref_type)) wtr.Kv_float(kv.Key(), Float_.cast(kv_val));
else if (Type_adp_.Eq(type, Double_.Cls_ref_type)) wtr.Kv_double(kv.Key(), Double_.cast(kv_val));
else if (Type_adp_.Eq(type, Bool_.Cls_ref_type)) wtr.Kv_bool(kv.Key(), Bool_.cast(kv_val));
else if (Type_adp_.Eq(type, Bool_.Cls_ref_type)) wtr.Kv_bool(kv.Key(), Bool_.Cast(kv_val));
else wtr.Kv_str(kv.Key(), Object_.Xto_str_strict_or_null(kv_val));
}
private void Encode_ary(Object ary) {

View File

@@ -166,7 +166,7 @@ public class Scrib_lib_ustring implements Scrib_lib {
for (int j = 0; j < grps_len; j++) {
Regx_group grp = grps[j];
if ( j < capts_len // bounds check b/c null can be passed
&& Bool_.cast(capts[j].Val()) // check if true; indicates that group is "()" or "anypos" see regex converter; DATE:2014-04-23
&& Bool_.Cast(capts[j].Val()) // check if true; indicates that group is "()" or "anypos" see regex converter; DATE:2014-04-23
)
tmp_list.Add(grp.Bgn() + Scrib_lib_ustring.Base1); // return index only for "()"; NOTE: do not return as String; callers expect int and will fail typed comparisons; DATE:2016-01-21
else