mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Refactor: Refactor Dbmeta classes; Rename methods of list and hash classes
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfml; import gplx.*;
|
||||
class GfmlParse_fxt {
|
||||
public GfmlNde_mok nde_() {return GfmlNde_mok.new_();}
|
||||
@@ -49,7 +49,7 @@ class GfmlParse_fxt {
|
||||
bldr.ThrowErrors_set(false);
|
||||
GfmlDoc actlDoc = bldr.XtoGfmlDoc(raw);
|
||||
List_adp expd = List_adp_.New(), actl = actlDoc.UsrMsgs();
|
||||
expd.Add_many((Object[])expdErrs);
|
||||
expd.AddMany((Object[])expdErrs);
|
||||
TfdsTstr_fxt tstr = TfdsTstr_fxt.new_();
|
||||
int max = tstr.List_Max(expd, actl);
|
||||
for (int i = 0; i < max; i++) {
|
||||
@@ -57,15 +57,15 @@ class GfmlParse_fxt {
|
||||
UsrMsg actlUm = (UsrMsg)tstr.List_FetchAtOrNull(actl, i);
|
||||
UsrMsg_mok actlUmm = UsrMsg_mok.new_(actlUm);
|
||||
tstr.Eq_str(expdUm.Main(), actlUmm.Main(), "main");
|
||||
for (int j = 0; j < expdUm.Args().Count(); j++) {
|
||||
for (int j = 0; j < expdUm.Args().Len(); j++) {
|
||||
Keyval expdKv = (Keyval)expdUm.Args().Get_at(j);
|
||||
Keyval actlKv = (Keyval)actlUmm.Args().Get_by(expdKv.Key());
|
||||
Keyval actlKv = (Keyval)actlUmm.Args().GetByOrNull(expdKv.Key());
|
||||
Object actlVal = actlKv == null ? String_.Null_mark : actlKv.Val();
|
||||
tstr.Eq_str(expdKv.Val(), actlVal, expdKv.Key());
|
||||
}
|
||||
for (int j = 0; j < expdUm.Required().Count(); j++) {
|
||||
for (int j = 0; j < expdUm.Required().Len(); j++) {
|
||||
String expdKv = (String)expdUm.Required().Get_at(j);
|
||||
Keyval actlKv = (Keyval)actlUmm.Args().Get_by(expdKv);
|
||||
Keyval actlKv = (Keyval)actlUmm.Args().GetByOrNull(expdKv);
|
||||
Object actlVal = actlKv == null ? String_.Null_mark : actlKv.Val();
|
||||
Object actlValV = actlKv == null ? "<<REQD>>" : actlKv.Val();
|
||||
tstr.Eq_str(actlValV, actlVal, expdKv);
|
||||
|
||||
@@ -51,7 +51,7 @@ class GfmlNde_mok implements GfmlItm_mok {
|
||||
public List_adp Subs() {return subs;}
|
||||
public String XtoStrStub() {
|
||||
String_bldr sb = String_bldr_.new_();
|
||||
sb.Add_kv("key=", key).Add_kv("hnd=", hnd).Add_kv("typ=", typ).Add_kv("subs=", Int_.To_str(subs.Count()));
|
||||
sb.Add_kv("key=", key).Add_kv("hnd=", hnd).Add_kv("typ=", typ).Add_kv("subs=", Int_.To_str(subs.Len()));
|
||||
return sb.To_str();
|
||||
}
|
||||
public GfmlNde_mok Subs_(GfmlItm_mok... ary) {
|
||||
@@ -75,7 +75,7 @@ class GfmlNde_mok implements GfmlItm_mok {
|
||||
rv.ChainId_(ownerMok.chainId);
|
||||
if (ownerMok.keyed) rv.KeyedSubObj_(ownerMok.keyed);
|
||||
if (ownerMok.key != null) rv.KeyTkn_set(GfmlTkn_.val_(ownerMok.key));
|
||||
for (int i = 0; i < ownerMok.subs.Count(); i++) {
|
||||
for (int i = 0; i < ownerMok.subs.Len(); i++) {
|
||||
GfmlItm_mok itm = (GfmlItm_mok)ownerMok.subs.Get_at(i);
|
||||
if (itm.ObjType() == GfmlObj_.Type_nde) {
|
||||
GfmlNde_mok itmMok = (GfmlNde_mok)itm;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfml; import gplx.*;
|
||||
class GfmlFld_mok {
|
||||
public String Name() {return name;} public GfmlFld_mok Name_(String v) {name = v; return this;} private String name;
|
||||
@@ -54,7 +54,7 @@ class GfmlTyp_mok {
|
||||
}
|
||||
public GfmlType XtoGfmlType() {
|
||||
GfmlType rv = GfmlType_.new_(key, name); // all types in tests are top-level
|
||||
for (int i = 0; i < subFlds.Count(); i++) {
|
||||
for (int i = 0; i < subFlds.Len(); i++) {
|
||||
GfmlFld_mok fld = (GfmlFld_mok)subFlds.Get_at(i);
|
||||
rv.SubFlds().Add(fld.XtoGfmlFld());
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfml; import gplx.*;
|
||||
class UsrMsg_mok {
|
||||
public String Main() {return main;} public UsrMsg_mok Main_(String v) {main = v; return this;} private String main;
|
||||
@@ -24,7 +24,7 @@ class UsrMsg_mok {
|
||||
UsrMsg_mok rv = new UsrMsg_mok();
|
||||
if (um != null) {
|
||||
rv.main = um.Hdr();
|
||||
for (int i = 0; i < um.Args().Count(); i++) {
|
||||
for (int i = 0; i < um.Args().Len(); i++) {
|
||||
Keyval kv = (Keyval)um.Args().Get_at(i);
|
||||
rv.Add_(kv.Key(), kv.Val());
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class z091_GfmlLxr_basic_tst {
|
||||
if (tkn == GfmlTkn_.EndOfStream) break;
|
||||
list.Add(tkn.Raw());
|
||||
}
|
||||
String[] actl = (String[])list.To_ary(String.class);
|
||||
String[] actl = (String[])list.ToAry(String.class);
|
||||
Tfds.Eq_ary(expd, actl);
|
||||
return tkn;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfml; import gplx.*;
|
||||
class GfmlDefaultItem_fxt {
|
||||
@gplx.Internal protected GfmlDefaultItem make_(String typeKey, String key, GfmlTkn val) {return GfmlDefaultItem.new_(typeKey, key, val);}
|
||||
@@ -29,7 +29,7 @@ class GfmlDefaultItem_fxt {
|
||||
GfmlDefaultItem expd = expdAry[i];
|
||||
tst_Item(actl, expd);
|
||||
}
|
||||
Tfds.Eq(expdAry.length, list.Count());
|
||||
Tfds.Eq(expdAry.length, list.Len());
|
||||
}
|
||||
String Val_to_str_or_null(GfmlObj gobj) {
|
||||
GfmlTkn tkn = GfmlTkn_.as_(gobj);
|
||||
|
||||
@@ -115,7 +115,7 @@ class GfmlUpdateFx {
|
||||
public GfmlUpdateFx Update_(GfmlUpdateCmd cmd) {cmds.Add(cmd); return this;} List_adp cmds = List_adp_.New();
|
||||
public GfmlUpdateFx tst_(String expd) {
|
||||
GfmlDoc actlDoc = GfmlDataNde.new_any_eol_(raw).Doc();
|
||||
for (int i = 0; i < cmds.Count(); i++) {
|
||||
for (int i = 0; i < cmds.Len(); i++) {
|
||||
GfmlUpdateCmd cmd = (GfmlUpdateCmd)cmds.Get_at(i);
|
||||
cmd.Exec(actlDoc);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class z811_useCase_GfmlIoSql_tst {
|
||||
GfmlAtr atr = (GfmlAtr)nde.SubObjs_GetAt(i);
|
||||
list.Add(atr.Key() + "=" + atr.DatTkn().Raw());
|
||||
}
|
||||
return list.To_str_ary();
|
||||
return list.ToStrAry();
|
||||
}
|
||||
GfmlNdeWrapper nde_(String name) {return GfmlNdeWrapper.new_().Name_(name);}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user