GfoNdeTstr.java 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /*
  2. XOWA: the XOWA Offline Wiki Application
  3. Copyright (C) 2012-2017 gnosygnu@gmail.com
  4. XOWA is licensed under the terms of the General Public License (GPL) Version 3,
  5. or alternatively under the terms of the Apache License Version 2.0.
  6. You may use XOWA according to either of these licenses as is most appropriate
  7. for your project on a case-by-case basis.
  8. The terms of each license can be found in the source code repository:
  9. GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
  10. Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
  11. */
  12. package gplx.dbs; import gplx.*;
  13. import gplx.core.gfo_ndes.*;
  14. public class GfoNdeTstr {
  15. public static void tst_ValsByCol(GfoNde nde, String fld, Object... expdAry) {
  16. List_adp expd = List_adp_.New();
  17. for (int i = 0; i < expdAry.length; i++) {
  18. expd.Add(Object_.Xto_str_strict_or_empty(expdAry[i]));
  19. }
  20. List_adp actl = List_adp_.New();
  21. for (int i = 0; i < nde.Subs().Count(); i++) {
  22. GfoNde sub = nde.Subs().FetchAt_asGfoNde(i);
  23. actl.Add(Object_.Xto_str_strict_or_empty(sub.Read(fld)));
  24. }
  25. Tfds.Eq_ary(expd.To_str_ary(), actl.To_str_ary());
  26. }
  27. }