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

Refactor: Remove whitespace after final and remove @gplx.Virtual

This commit is contained in:
gnosygnu
2021-11-28 08:45:40 -05:00
parent b0082fd231
commit 231e10bc19
2362 changed files with 43007 additions and 42938 deletions

View File

@@ -1,25 +1,25 @@
/*
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.core.brys; import gplx.*; import gplx.core.*;
public class Bit_heap_wtr {
private final gplx.xowa.htmls.core.hzips.Xoh_hzip_int hzip_int = new gplx.xowa.htmls.core.hzips.Xoh_hzip_int().Mode_is_b256_(true);
private final Bry_bfr hzip_int_bfr = Bry_bfr_.Reset(5);
private final gplx.xowa.htmls.core.hzips.Xoh_hzip_int hzip_int = new gplx.xowa.htmls.core.hzips.Xoh_hzip_int().Mode_is_b256_(true);
private final Bry_bfr hzip_int_bfr = Bry_bfr_.Reset(5);
public int Cur() {return cur;} private int cur;
public int Cur_bits() {return cur_bits;} private int cur_bits;
public Bry_bfr Heap() {return heap;} private final Bry_bfr heap = Bry_bfr_.New();
public Bry_bfr Heap() {return heap;} private final Bry_bfr heap = Bry_bfr_.New();
public void Clear() {heap.Clear(); cur = 0; cur_bits = 0;}
public void Add_bool(boolean v) {
if (v)
@@ -65,5 +65,5 @@ public class Bit_heap_wtr {
hzip_int_bfr.Clear();
}
public void Save(Bry_bfr bfr) {}
public static final int[] Pow_ary = new int[] {1, 2, 4, 8, 16, 32, 64, 128, 256};
public static final int[] Pow_ary = new int[] {1, 2, 4, 8, 16, 32, 64, 128, 256};
}

View File

@@ -13,12 +13,12 @@ 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.core.brys; import gplx.*; import gplx.core.*;
import gplx.core.lists.*;
public class Bry_comparer implements ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
byte[] lhs = (byte[])lhsObj, rhs = (byte[])rhsObj;
return Bry_.Compare(lhs, 0, lhs.length, rhs, 0, rhs.length);
}
public static final Bry_comparer Instance = new Bry_comparer(); Bry_comparer() {} // TS.static
}
package gplx.core.brys; import gplx.*; import gplx.core.*;
import gplx.core.lists.*;
public class Bry_comparer implements ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
byte[] lhs = (byte[])lhsObj, rhs = (byte[])rhsObj;
return Bry_.Compare(lhs, 0, lhs.length, rhs, 0, rhs.length);
}
public static final Bry_comparer Instance = new Bry_comparer(); Bry_comparer() {} // TS.static
}

View File

@@ -1,22 +1,22 @@
/*
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.core.brys.evals; import gplx.*; import gplx.core.*; import gplx.core.brys.*;
public class Bry_eval_mgr {
private final Hash_adp_bry hash = Hash_adp_bry.cs();
private final byte sym_escape, sym_key_end, sym_grp_bgn, sym_grp_end;
private final Hash_adp_bry hash = Hash_adp_bry.cs();
private final byte sym_escape, sym_key_end, sym_grp_bgn, sym_grp_end;
public Bry_eval_mgr(byte sym_escape, byte sym_key_end, byte sym_grp_bgn, byte sym_grp_end) {
this.sym_escape = sym_escape;
this.sym_key_end = sym_key_end;
@@ -101,6 +101,6 @@ class Bry_eval_rslt {
public Bry_eval_rslt(byte[] bry, int pos) {
this.bry = bry; this.pos = pos;
}
public byte[] Bry() {return bry;} private final byte[] bry;
public int Pos() {return pos;} private final int pos;
public byte[] Bry() {return bry;} private final byte[] bry;
public int Pos() {return pos;} private final int pos;
}

View File

@@ -1,22 +1,22 @@
/*
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.core.brys.evals; import gplx.*; import gplx.core.*; import gplx.core.brys.*;
import org.junit.*; import gplx.core.tests.*;
public class Bry_eval_mgr__tst {
private final Bry_eval_mgr__fxt fxt = new Bry_eval_mgr__fxt();
private final Bry_eval_mgr__fxt fxt = new Bry_eval_mgr__fxt();
@Test public void Text() {fxt.Test__eval("abc" , "abc");}
@Test public void Args_0() {fxt.Test__eval("abc~{test}xyz" , "abctestxyz");}
@Test public void Args_n() {fxt.Test__eval("abc~{concat|d|e|f}xyz" , "abcdefxyz");}
@@ -27,7 +27,7 @@ public class Bry_eval_mgr__tst {
// @Test public void Eos() {fxt.Test__eval("a~" , "a~");}
}
class Bry_eval_mgr__fxt {
private final Bry_eval_mgr mgr = Bry_eval_mgr.Dflt().Add_many(new Bry_eval_wkr__test(), new Bry_eval_wkr__concat());
private final Bry_eval_mgr mgr = Bry_eval_mgr.Dflt().Add_many(new Bry_eval_wkr__test(), new Bry_eval_wkr__concat());
public Bry_eval_mgr__fxt Test__eval(String raw, String expd) {
Gftest.Eq__bry(Bry_.new_u8(expd), mgr.Eval(Bry_.new_u8(raw)));
return this;

View File

@@ -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.core.caches; import gplx.*; import gplx.core.*;
import gplx.core.envs.*;
class Gfo_cache_data implements gplx.CompareAble, Rls_able {
@@ -22,7 +22,7 @@ class Gfo_cache_data implements gplx.CompareAble, Rls_able {
this.size = size;
this.count = 1;
}
public byte[] Key() {return key;} private final byte[] key;
public byte[] Key() {return key;} private final byte[] key;
public Rls_able Val() {return val;} private Rls_able val;
public int Size() {return size;} private int size;

View File

@@ -1,22 +1,22 @@
/*
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.core.caches; import gplx.*; import gplx.core.*;
public class Gfo_cache_mgr {
private final Ordered_hash hash = Ordered_hash_.New_bry();
private final List_adp tmp_delete = List_adp_.New();
private final Ordered_hash hash = Ordered_hash_.New_bry();
private final List_adp tmp_delete = List_adp_.New();
public int Cur_size() {return cur_size;} private int cur_size;
public int Max_size() {return max_size;} public Gfo_cache_mgr Max_size_(int v) {max_size = v; return this;} private int max_size;
public int Reduce_by() {return reduce_by;} public Gfo_cache_mgr Reduce_by_(int v) {reduce_by = v; return this;} private int reduce_by;

View File

@@ -1,21 +1,21 @@
/*
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.core.caches; import gplx.*; import gplx.core.*;
public class Gfo_cache_mgr_base {
private final Ordered_hash hash = Ordered_hash_.New_bry();
private final Ordered_hash hash = Ordered_hash_.New_bry();
public int Compress_max() {return compress_max;} public void Compress_max_(int v) {compress_max = v;} private int compress_max = 16;
public int Compress_to() {return compress_to;} public void Compress_to_(int v) {compress_to = v;} private int compress_to = 8;
protected Object Base_get_or_null(byte[] key) {

View File

@@ -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.core.caches; import gplx.*; import gplx.core.*;
import gplx.core.primitives.*; import gplx.core.envs.*;
public class Gfo_cache_mgr_bry extends Gfo_cache_mgr_base {
@@ -33,7 +33,7 @@ class Gfo_cache_itm_comparer implements gplx.core.lists.ComparerAble {
Gfo_cache_itm_bry rhs = (Gfo_cache_itm_bry)rhsObj;
return Long_.Compare(lhs.Touched(), rhs.Touched());
}
public static final Gfo_cache_itm_comparer Touched_asc = new Gfo_cache_itm_comparer(); // TS.static
public static final Gfo_cache_itm_comparer Touched_asc = new Gfo_cache_itm_comparer(); // TS.static
}
class Io_url_exists_mgr {
private gplx.core.caches.Gfo_cache_mgr_bry cache_mgr = new gplx.core.caches.Gfo_cache_mgr_bry();

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.caches; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*;
public class Gfo_cache_mgr_tst {
@Before public void init() {fxt.Clear();} private final Gfo_cache_mgr_fxt fxt = new Gfo_cache_mgr_fxt();
@Before public void init() {fxt.Clear();} private final Gfo_cache_mgr_fxt fxt = new Gfo_cache_mgr_fxt();
@Test public void Basic() {
fxt.Exec__add("a");
fxt.Test__cur_size(1);
@@ -35,7 +35,7 @@ public class Gfo_cache_mgr_tst {
}
}
class Gfo_cache_mgr_fxt {
private final Gfo_cache_mgr mgr = new Gfo_cache_mgr().Max_size_(4).Reduce_by_(2);
private final Gfo_cache_mgr mgr = new Gfo_cache_mgr().Max_size_(4).Reduce_by_(2);
public void Clear() {mgr.Clear();}
public Gfo_cache_mgr_fxt Exec__add(String... ary) {
int len = ary.length;

View File

@@ -1,24 +1,24 @@
/*
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.core.consoles; import gplx.*; import gplx.core.*;
public class Gfo_cmd_arg_itm {
public Gfo_cmd_arg_itm(int tid, boolean reqd, String key, int val_tid) {this.tid = tid; this.reqd = reqd; this.key = key; this.val_tid = val_tid;}
public int Tid() {return tid;} private final int tid;
public boolean Reqd() {return reqd;} private final boolean reqd;
public String Key() {return key;} private final String key;
public int Tid() {return tid;} private final int tid;
public boolean Reqd() {return reqd;} private final boolean reqd;
public String Key() {return key;} private final String key;
public int Val_tid() {return val_tid;} private int val_tid;
public Object Val() {return val;} public Gfo_cmd_arg_itm Val_(Object v) {this.val = v; dirty = true; return this;} private Object val;
public String Note() {return note;} public Gfo_cmd_arg_itm Note_(String v) {note = v; return this;} private String note = "";

View File

@@ -1,22 +1,22 @@
/*
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.core.consoles; import gplx.*; import gplx.core.*;
public class Gfo_cmd_arg_mgr {
private final Ordered_hash hash = Ordered_hash_.New();
private final List_adp err_list = List_adp_.New(), tmp_vals = List_adp_.New();
private final Ordered_hash hash = Ordered_hash_.New();
private final List_adp err_list = List_adp_.New(), tmp_vals = List_adp_.New();
public String[] Orig_ary() {return orig_ary;} private String[] orig_ary;
public void Reset() {
hash.Clear();

View File

@@ -1,22 +1,22 @@
/*
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.core.consoles; import gplx.*; import gplx.core.*;
public class Gfo_cmd_arg_mgr_printer {
private final Gfo_cmd_arg_mgr arg_mgr;
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
private final Gfo_cmd_arg_mgr arg_mgr;
private final Bry_bfr tmp_bfr = Bry_bfr_.New();
public Gfo_cmd_arg_mgr_printer(Gfo_cmd_arg_mgr arg_mgr) {this.arg_mgr = arg_mgr;}
public boolean Print(Gfo_usr_dlg usr_dlg, String header, String app_name, String key__print_help, String key__print_header, String key__print_args) {
if (arg_mgr.Get_by_as_bool(key__print_header))

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.consoles; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*; import gplx.core.envs.*;
public class Gfo_cmd_arg_mgr_tst {
@Before public void init() {fxt.Clear();} private final Gfo_cmd_arg_mgr_fxt fxt = new Gfo_cmd_arg_mgr_fxt();
@Before public void init() {fxt.Clear();} private final Gfo_cmd_arg_mgr_fxt fxt = new Gfo_cmd_arg_mgr_fxt();
@Test public void Val__many() {
fxt.Init_args(fxt.Make_arg("a"), fxt.Make_arg("b"));
fxt.Exec_process("--a", "0", "--b", "1");
@@ -67,9 +67,9 @@ public class Gfo_cmd_arg_mgr_tst {
}
}
class Gfo_cmd_arg_mgr_fxt {
private final Tst_mgr tst_mgr = new Tst_mgr();
private final Tst_mgr tst_mgr = new Tst_mgr();
public Gfo_usr_dlg Usr_dlg() {return usr_dlg;} Gfo_usr_dlg usr_dlg;
public Gfo_cmd_arg_mgr Mgr() {return mgr;} private final Gfo_cmd_arg_mgr mgr = new Gfo_cmd_arg_mgr();
public Gfo_cmd_arg_mgr Mgr() {return mgr;} private final Gfo_cmd_arg_mgr mgr = new Gfo_cmd_arg_mgr();
public Gfo_cmd_arg_mgr_fxt Clear() {
if (usr_dlg == null)
usr_dlg = Gfo_usr_dlg_.Test();

View File

@@ -13,16 +13,16 @@ 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.core.data_stores; import gplx.*; import gplx.core.*;
public class Gfo_data_store {
private final Hash_adp hash = Hash_adp_.New();
public Gfo_data_itm Get_or_null(String key) {
return (Gfo_data_itm)hash.Get_by(key);
}
public void Set(Gfo_data_itm itm) {
hash.Add_if_dupe_use_nth(itm.Key(), itm);
}
public void Clear() {
hash.Clear();
}
}
package gplx.core.data_stores; import gplx.*; import gplx.core.*;
public class Gfo_data_store {
private final Hash_adp hash = Hash_adp_.New();
public Gfo_data_itm Get_or_null(String key) {
return (Gfo_data_itm)hash.Get_by(key);
}
public void Set(Gfo_data_itm itm) {
hash.Add_if_dupe_use_nth(itm.Key(), itm);
}
public void Clear() {
hash.Clear();
}
}

View File

@@ -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.core.flds; import gplx.*; import gplx.core.*;
import gplx.core.encoders.*;
public class Gfo_fld_rdr extends Gfo_fld_base {
@@ -120,5 +120,5 @@ public class Gfo_fld_rdr extends Gfo_fld_base {
public Gfo_fld_rdr Ctor_sql() {return (Gfo_fld_rdr)super.Ctor_sql_base();}
public static Gfo_fld_rdr xowa_() {return new Gfo_fld_rdr().Ctor_xdat();}
public static Gfo_fld_rdr sql_() {return new Gfo_fld_rdr().Ctor_sql();}
private static final byte[] Bry_nil = Bry_.new_a7("\\0");
private static final byte[] Bry_nil = Bry_.new_a7("\\0");
}

View File

@@ -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.core.gfobjs; import gplx.*; import gplx.core.*;
public interface Gfobj_fld {
byte Fld_tid();
@@ -33,56 +33,56 @@ class Gfobj_fld_ {
}
class Gfobj_fld_str implements Gfobj_fld {
public Gfobj_fld_str(String key, String val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__str;}
public Object As_obj() {return val;}
public String As_str() {return val;} private String val;
}
class Gfobj_fld_bry implements Gfobj_fld {
public Gfobj_fld_bry(String key, byte[] val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__bry;}
public Object As_obj() {return val;}
public byte[] As_bry() {return val;} private byte[] val;
}
class Gfobj_fld_bool implements Gfobj_fld {
public Gfobj_fld_bool(String key, boolean val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__bool;}
public Object As_obj() {return val;}
public boolean As_bool() {return val;} private boolean val;
}
class Gfobj_fld_int implements Gfobj_fld {
public Gfobj_fld_int(String key, int val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__int;}
public Object As_obj() {return val;}
public int As_int() {return val;} private int val;
}
class Gfobj_fld_long implements Gfobj_fld {
public Gfobj_fld_long(String key, long val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__long;}
public Object As_obj() {return val;}
public long As_long() {return val;} private long val;
}
class Gfobj_fld_double implements Gfobj_fld {
public Gfobj_fld_double(String key, double val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__double;}
public Object As_obj() {return val;}
public double As_double() {return val;} private double val;
}
class Gfobj_fld_nde implements Gfobj_fld {
public Gfobj_fld_nde(String key, Gfobj_nde val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__nde;}
public Object As_obj() {return val;}
public Gfobj_nde As_nde() {return val;} private Gfobj_nde val;
}
class Gfobj_fld_ary implements Gfobj_fld {
public Gfobj_fld_ary(String key, Gfobj_ary val) {this.key = key; this.val = val;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public byte Fld_tid() {return Gfobj_fld_.Fld_tid__ary;}
public Object As_obj() {return val;}
public Gfobj_ary As_ary() {return val;} private Gfobj_ary val;

View File

@@ -17,7 +17,7 @@ package gplx.core.gfobjs; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*;
import gplx.langs.jsons.*;
public class Gfobj_rdr__json_tst {
private final Gfobj_wtr__json_fxt fxt = new Gfobj_wtr__json_fxt();
private final Gfobj_wtr__json_fxt fxt = new Gfobj_wtr__json_fxt();
@Test public void Type() {
fxt.Test__parse(String_.Concat_lines_nl_skip_last
( "{ 'k1':true"

View File

@@ -1,22 +1,22 @@
/*
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.core.gfobjs; import gplx.*; import gplx.core.*;
import gplx.langs.jsons.*;
public class Gfobj_wtr__json {
private final Json_wtr wtr = new Json_wtr();
private final Json_wtr wtr = new Json_wtr();
public Gfobj_wtr__json Opt_ws_(boolean v) {wtr.Opt_ws_(v); return this;}
public Gfobj_wtr__json Opt_backslash_2x_(boolean v) {wtr.Opt_backslash_2x_(v); return this;}
public Bry_bfr Bfr() {return wtr.Bfr();}

View File

@@ -1,22 +1,22 @@
/*
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.core.gfobjs; import gplx.*; import gplx.core.*;
import gplx.core.tests.*; import gplx.langs.jsons.*;
public class Gfobj_wtr__json_fxt {
protected final Gfobj_wtr__json mgr = new Gfobj_wtr__json();
protected final Gfobj_wtr__json mgr = new Gfobj_wtr__json();
public Gfobj_nde Make__nde(Gfobj_fld... ary) {return Make__nde(Gfobj_nde.New(), ary);}
private Gfobj_nde Make__nde(Gfobj_nde nde, Gfobj_fld[] ary) {
int len = ary.length;

View File

@@ -1,23 +1,23 @@
/*
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.core.gfobjs; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*;
import gplx.langs.jsons.*;
public class Gfobj_wtr__json_tst {
private final Gfobj_wtr__json_fxt fxt = new Gfobj_wtr__json_fxt();
private final Gfobj_wtr__json_fxt fxt = new Gfobj_wtr__json_fxt();
@Test public void Flds() {
fxt.Test__write
( fxt.Make__nde

View File

@@ -1,23 +1,23 @@
/*
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.core.intls.ucas; import gplx.*; import gplx.core.*; import gplx.core.intls.*;
public class Uca_ltr_extractor {
private final boolean numeric;
private final byte[] numeric_heading;
private final Hash_adp_bry numeric_hash;
private final boolean numeric;
private final byte[] numeric_heading;
private final Hash_adp_bry numeric_hash;
public Uca_ltr_extractor(boolean numeric) {
this.numeric = numeric;
if (numeric) {

View File

@@ -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.core.ios; import gplx.*; import gplx.core.*;
import gplx.core.ios.streams.*;/*IoStream*/
public class Io_buffer_rdr implements Rls_able {
@@ -67,5 +67,5 @@ public class Io_buffer_rdr implements Rls_able {
rv.Bfr_load(0, bfr_len);
return rv;
}
public static final Io_buffer_rdr Null = new Io_buffer_rdr(); Io_buffer_rdr() {}
public static final Io_buffer_rdr Null = new Io_buffer_rdr(); Io_buffer_rdr() {}
}

View File

@@ -13,15 +13,15 @@ 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.core.ios; import gplx.*; import gplx.core.*;
public interface Io_sort_filCmd {
void Bfr_add(Io_line_rdr stream);
void Fil_bgn(Io_line_rdr stream);
void Fil_end();
}
class Io_sort_filCmd_null implements Io_sort_filCmd {
public void Bfr_add(Io_line_rdr stream) {}
public void Fil_bgn(Io_line_rdr stream) {}
public void Fil_end() {}
public static final Io_sort_filCmd_null Instance = new Io_sort_filCmd_null(); Io_sort_filCmd_null() {} // TS.static
}
package gplx.core.ios; import gplx.*; import gplx.core.*;
public interface Io_sort_filCmd {
void Bfr_add(Io_line_rdr stream);
void Fil_bgn(Io_line_rdr stream);
void Fil_end();
}
class Io_sort_filCmd_null implements Io_sort_filCmd {
public void Bfr_add(Io_line_rdr stream) {}
public void Fil_bgn(Io_line_rdr stream) {}
public void Fil_end() {}
public static final Io_sort_filCmd_null Instance = new Io_sort_filCmd_null(); Io_sort_filCmd_null() {} // TS.static
}

View File

@@ -13,11 +13,11 @@ 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.core.ios; import gplx.*; import gplx.core.*;
public class Io_sort_split_itm_sorter implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
Io_sort_split_itm lhs = (Io_sort_split_itm)lhsObj, rhs = (Io_sort_split_itm)rhsObj;
return Bry_.Compare(lhs.Bfr(), lhs.Key_bgn(), lhs.Key_end(), rhs.Bfr(), rhs.Key_bgn(), rhs.Key_end());
}
public static final Io_sort_split_itm_sorter Instance = new Io_sort_split_itm_sorter(); Io_sort_split_itm_sorter() {} // TS.static
}
package gplx.core.ios; import gplx.*; import gplx.core.*;
public class Io_sort_split_itm_sorter implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
Io_sort_split_itm lhs = (Io_sort_split_itm)lhsObj, rhs = (Io_sort_split_itm)rhsObj;
return Bry_.Compare(lhs.Bfr(), lhs.Key_bgn(), lhs.Key_end(), rhs.Bfr(), rhs.Key_bgn(), rhs.Key_end());
}
public static final Io_sort_split_itm_sorter Instance = new Io_sort_split_itm_sorter(); Io_sort_split_itm_sorter() {} // TS.static
}

View File

@@ -1,21 +1,21 @@
/*
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.core.lists; import gplx.*; import gplx.core.*;
public class Binary_heap {
private final ComparerAble comparer;
private final ComparerAble comparer;
private boolean is_max;
private Object[] heap;
private int size;

View File

@@ -17,7 +17,7 @@ package gplx.core.lists; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*;
import gplx.core.primitives.*;
public class Binary_heap_tst {
private final Binary_heap_fxt fxt = new Binary_heap_fxt();
private final Binary_heap_fxt fxt = new Binary_heap_fxt();
@Test public void Max() {
fxt.Init(Bool_.Y);
fxt.Exec__add(4, 3, 5, 7, 1, 6, 9, 8, 2);

View File

@@ -1,23 +1,23 @@
/*
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.core.lists; import gplx.*; import gplx.core.*;
import gplx.core.primitives.*;
public class HashByInt {
private final Ordered_hash hash = Ordered_hash_.New();
private final Int_obj_ref tmp_key = Int_obj_ref.New_neg1();
private final Ordered_hash hash = Ordered_hash_.New();
private final Int_obj_ref tmp_key = Int_obj_ref.New_neg1();
public void Clear() {
hash.Clear();
}
@@ -58,8 +58,8 @@ public class HashByInt {
}
}
class HashByIntItem {
public final int key;
public final Object val;
public final int key;
public final Object val;
public HashByIntItem(int key, Object val) {
this.key = key;
this.val = val;

View File

@@ -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.core.lists; import gplx.*; import gplx.core.*;
public class Queue_adp {
private int count;
@@ -44,7 +44,7 @@ public class Queue_adp {
}
}
class Queue_itm {
private final Object data;
private final Object data;
public Queue_itm next;
public Queue_itm(Object data) {
this.data = data;

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.lists; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*;
public class Queue_adp_tst {
private final Queue_adp_fxt fxt = new Queue_adp_fxt();
private final Queue_adp_fxt fxt = new Queue_adp_fxt();
@Test public void Empty() {
boolean pass = true;
try {
@@ -50,7 +50,7 @@ public class Queue_adp_tst {
}
}
class Queue_adp_fxt {
private final Queue_adp queue = new Queue_adp();
private final Queue_adp queue = new Queue_adp();
public void Exec__enqueue(String s) {queue.Enqueue(s);}
public void Test__dequeue(String expd_data, int expd_len) {
Gftest.Eq__str(expd_data, (String)queue.Dequeue());

View File

@@ -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.core.lists; import gplx.*; import gplx.core.*;
class StatRng_fxt { // UNUSED:useful for stat processing
StatRng rng;
@@ -61,10 +61,10 @@ class StatRng {
public long Sum = 0;
public int Count = 0;
public float Avg() {return Sum / Count;}
public final StatItm[] Lo_ary;
public final StatItm[] Lo_ary;
public int Lo_ary_bound;
public int Lo_ary_len;
public final StatItm[] Hi_ary;
public final StatItm[] Hi_ary;
public int Hi_ary_bound;
public int Hi_ary_len;
public StatRng[] Slot_ary;

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.lists.binary_searches; import gplx.*; import gplx.core.*; import gplx.core.lists.*;
import org.junit.*; import gplx.core.primitives.*;
public class Binary_search__tst {
private final Binary_search__fxt fxt = new Binary_search__fxt();
private final Binary_search__fxt fxt = new Binary_search__fxt();
@Test public void Basic() {
fxt.Init__ary("", "e", "j", "o", "t", "y");
fxt.Test__binary_search("a", 0);

View File

@@ -1,32 +1,32 @@
/*
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.core.lists.binary_searches; import gplx.*; import gplx.core.*; import gplx.core.lists.*;
import gplx.core.lists.*;
interface Binary_search_cmp {
int Compare(Object comp);
}
class Binary_search_cmp__comparable implements Binary_search_cmp {
private final CompareAble val;
private final CompareAble val;
public Binary_search_cmp__comparable(CompareAble val) {this.val = val;}
public int Compare(Object comp) {
return val.compareTo((CompareAble)comp);
}
}
class Binary_search_cmp__comparer implements Binary_search_cmp {
private final Binary_comparer comparer; private final Object val;
private final Binary_comparer comparer; private final Object val;
public Binary_search_cmp__comparer(Binary_comparer comparer, Object val) {this.comparer = comparer; this.val = val;}
public int Compare(Object comp) {
return comparer.Compare_val_to_obj(val, comp);

View File

@@ -1,31 +1,31 @@
/*
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.core.lists.binary_searches; import gplx.*; import gplx.core.*; import gplx.core.lists.*;
interface Binary_search_grp {
int Len();
Object Get_at(int i);
}
class Binary_search_grp__ary implements Binary_search_grp {
private final Object[] ary;
private final Object[] ary;
public Binary_search_grp__ary(Object[] ary) {this.ary = ary;}
public int Len() {return ary.length;}
public Object Get_at(int i) {return ary[i];}
}
class Binary_search_grp__list implements Binary_search_grp {
private final List_adp list;
private final List_adp list;
public Binary_search_grp__list(List_adp list) {this.list = list;}
public int Len() {return list.Len();}
public Object Get_at(int i) {return list.Get_at(i);}

View File

@@ -1,21 +1,21 @@
/*
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.core.lists.caches; import gplx.*; import gplx.core.*; import gplx.core.lists.*;
class Mru_cache_itm {
private final long time_bgn;
private final long time_bgn;
private long time_dirty;
private long used_dirty = -1;
public Mru_cache_itm(Object key, Object val, long size, long time) {
@@ -24,8 +24,8 @@ class Mru_cache_itm {
this.size = size;
this.time_bgn = this.time_cur = time;
}
public Object Key() {return key;} private final Object key;
public Object Val() {return val;} private final Object val;
public Object Key() {return key;} private final Object key;
public Object Val() {return val;} private final Object val;
public long Size() {return size;} private long size;
public long Time_cur() {return time_cur;} private long time_cur;
public long Time_dif() {return time_cur - time_bgn;}

View File

@@ -1,28 +1,28 @@
/*
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.core.lists.caches; import gplx.*; import gplx.core.*; import gplx.core.lists.*;
import gplx.core.logs.*;
public class Mru_cache_mgr {
private final Mru_cache_time_mgr time_mgr;
private final Gfo_log_wtr log_wtr;
private final Hash_adp key_hash = Hash_adp_.New();
private final Sorted_hash val_hash;
private final Bry_bfr log_bfr = Bry_bfr_.New_w_size(255);
private final Mru_cache_itm_comparer comparer;
private final Ordered_hash dirty = Ordered_hash_.New();
private final Mru_cache_time_mgr time_mgr;
private final Gfo_log_wtr log_wtr;
private final Hash_adp key_hash = Hash_adp_.New();
private final Sorted_hash val_hash;
private final Bry_bfr log_bfr = Bry_bfr_.New_w_size(255);
private final Mru_cache_itm_comparer comparer;
private final Ordered_hash dirty = Ordered_hash_.New();
private long cache_max, cache_size, compress_size;
Mru_cache_mgr(Mru_cache_time_mgr time_mgr, Gfo_log_wtr log_wtr, long cache_max, long compress_size, long used_weight) {
this.time_mgr = time_mgr;

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.lists.caches; import gplx.*; import gplx.core.*; import gplx.core.lists.*;
import org.junit.*; import gplx.core.tests.*;
public class Mru_cache_mgr_tst {
private final Mru_cache_mgr_fxt fxt = new Mru_cache_mgr_fxt();
private final Mru_cache_mgr_fxt fxt = new Mru_cache_mgr_fxt();
@Before public void init() {
fxt.Init__New_cache_mgr(3, 3, 2);
}
@@ -50,7 +50,7 @@ public class Mru_cache_mgr_tst {
}
}
class Mru_cache_mgr_fxt {
private final Mru_cache_time_mgr__mock time_mgr = new Mru_cache_time_mgr__mock();
private final Mru_cache_time_mgr__mock time_mgr = new Mru_cache_time_mgr__mock();
private Mru_cache_mgr cache_mgr;
public void Init__New_cache_mgr(long cache_max, long used_weight, long compress_size) {
cache_mgr = Mru_cache_mgr.New_test(time_mgr, null, cache_max, used_weight, compress_size);

View File

@@ -1,26 +1,26 @@
/*
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.core.logs; import gplx.*; import gplx.core.*;
public class Gfo_log_wtr {
private final Bry_bfr bfr = Bry_bfr_.New();
private final int bfr_max;
private final int fil_max;
private final Io_url fil_dir;
private final String fil_fmt;
private final int fil_idx_places;
private final Bry_bfr bfr = Bry_bfr_.New();
private final int bfr_max;
private final int fil_max;
private final Io_url fil_dir;
private final String fil_fmt;
private final int fil_idx_places;
private Io_url fil_url;
private int fil_idx = -1, fil_len;
public Gfo_log_wtr(int bfr_max, int fil_max, Io_url fil_dir, String fil_fmt, int fil_idx_places) {

View File

@@ -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.core.net; import gplx.*; import gplx.core.*;
public class Gfo_inet_conn_ {
public static final int Tid__http = 1, Tid__mem__hash = 2, Tid__mem__pile = 3;
@@ -30,14 +30,14 @@ public class Gfo_inet_conn_ {
public static void new_prototype_(int v) {new_prototype = v;} private static int new_prototype = Tid__http;
}
class Gfo_inet_conn__mem__hash implements Gfo_inet_conn {
private final Hash_adp hash = Hash_adp_.New();
private final Hash_adp hash = Hash_adp_.New();
public int Tid() {return Gfo_inet_conn_.Tid__mem__hash;}
public void Clear() {hash.Clear();}
public void Upload_by_bytes(String url, byte[] data) {hash.Add(url, data);}
public byte[] Download_as_bytes_or_null(String url) {return (byte[])hash.Get_by(url);}
}
class Gfo_inet_conn__mem__pile implements Gfo_inet_conn {
private final List_adp pile = List_adp_.New();
private final List_adp pile = List_adp_.New();
public int Tid() {return Gfo_inet_conn_.Tid__mem__hash;}
public void Clear() {pile.Clear();}
public void Upload_by_bytes(String url, byte[] data) {pile.Add(data);}

View File

@@ -1,22 +1,22 @@
/*
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.core.net; import gplx.*; import gplx.core.*;
import gplx.core.net.qargs.*;
public class Gfo_url {
private final int segs__len;
private final int segs__len;
public Gfo_url(byte[] raw, byte protocol_tid, byte[] protocol_bry, byte[][] segs, Gfo_qarg_itm[] qargs, byte[] anch) {
this.raw = raw;
this.protocol_tid = protocol_tid; this.protocol_bry = protocol_bry;
@@ -24,15 +24,15 @@ public class Gfo_url {
this.qargs = qargs;
this.anch = anch;
}
public byte[] Raw() {return raw;} private final byte[] raw;
public byte Protocol_tid() {return protocol_tid;} private final byte protocol_tid;
public byte[] Protocol_bry() {return protocol_bry;} private final byte[] protocol_bry;
public byte[] Anch() {return anch;} private final byte[] anch;
public Gfo_qarg_itm[] Qargs() {return qargs;} private final Gfo_qarg_itm[] qargs;
public byte[][] Segs() {return segs;} private final byte[][] segs;
public byte[] Raw() {return raw;} private final byte[] raw;
public byte Protocol_tid() {return protocol_tid;} private final byte protocol_tid;
public byte[] Protocol_bry() {return protocol_bry;} private final byte[] protocol_bry;
public byte[] Anch() {return anch;} private final byte[] anch;
public Gfo_qarg_itm[] Qargs() {return qargs;} private final Gfo_qarg_itm[] qargs;
public byte[][] Segs() {return segs;} private final byte[][] segs;
public byte[] Segs__get_at(int i) {return i < segs__len ? segs[i] : null;}
public byte[] Segs__get_at_1st() {return segs__len > 0 ? segs[0] : null;}
public byte[] Segs__get_at_nth() {return segs__len > 1 ? segs[segs__len - 1] : null;}
public static final Gfo_url Empty = new Gfo_url(Bry_.Empty, Gfo_protocol_itm.Tid_unknown, Bry_.Empty, Bry_.Ary_empty, null, null);
public static final Gfo_url Empty = new Gfo_url(Bry_.Empty, Gfo_protocol_itm.Tid_unknown, Bry_.Empty, Bry_.Ary_empty, null, null);
}

View File

@@ -1,27 +1,27 @@
/*
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.core.net; import gplx.*; import gplx.core.*;
import gplx.core.btries.*;
import gplx.core.net.qargs.*;
import gplx.langs.htmls.encoders.*;
public class Gfo_url_parser {
private final Btrie_slim_mgr protocols = Btrie_slim_mgr.ci_a7(); // ASCII:url_protocol; EX:"http:", "ftp:", etc
private final Btrie_rv trv = new Btrie_rv();
private final List_adp segs_list = List_adp_.New(), qargs_list = List_adp_.New();
private final Bry_bfr tmp_bfr = Bry_bfr_.Reset(500);
private final Btrie_slim_mgr protocols = Btrie_slim_mgr.ci_a7(); // ASCII:url_protocol; EX:"http:", "ftp:", etc
private final Btrie_rv trv = new Btrie_rv();
private final List_adp segs_list = List_adp_.New(), qargs_list = List_adp_.New();
private final Bry_bfr tmp_bfr = Bry_bfr_.Reset(500);
public Gfo_url_parser() {
Init_protocols(Gfo_protocol_itm.Ary());
Init_protocol_itm(Gfo_protocol_itm.Bry_relative, Gfo_protocol_itm.Tid_relative_1);
@@ -180,5 +180,5 @@ public class Gfo_url_parser {
return encoded ? Gfo_url_encoder_.Xourl.Decode(tmp_bfr, Bool_.N, src, bgn, end).To_bry_and_clear() : Bry_.Mid(src, bgn, end);
}
public static final byte[] Bry_double_slash = new byte[] {Byte_ascii.Slash, Byte_ascii.Slash};
public static final byte[] Bry_double_slash = new byte[] {Byte_ascii.Slash, Byte_ascii.Slash};
}

View File

@@ -1,22 +1,22 @@
/*
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.core.net; import gplx.*; import gplx.core.*;
import gplx.core.net.qargs.*;
class Gfo_url_parser_fxt {
private final Gfo_url_parser parser = new Gfo_url_parser();
private final Gfo_url_parser parser = new Gfo_url_parser();
private Gfo_url actl;
public Gfo_url_parser_fxt Test__protocol_tid(byte v) {Tfds.Eq_byte(v, actl.Protocol_tid(), "protocol_tid"); return this;}
public Gfo_url_parser_fxt Test__protocol_bry(String v) {Tfds.Eq_str(v, actl.Protocol_bry(), "protocol_bry"); return this;}
@@ -38,7 +38,7 @@ class Gfo_url_parser_fxt {
parser.Parse_site_fast(site_data, raw_bry, 0, raw_bry.length);
String actl = String_.new_u8(raw_bry, site_data.Site_bgn(), site_data.Site_end());
Tfds.Eq(expd, actl);
} private final Gfo_url_site_data site_data = new Gfo_url_site_data();
} private final Gfo_url_site_data site_data = new Gfo_url_site_data();
private static String Qargs__To_str(Gfo_qarg_itm[] ary) {
int len = ary.length;
Bry_bfr bfr = Bry_bfr_.New();

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.net; import gplx.*; import gplx.core.*;
import org.junit.*;
public class Gfo_url_parser_tst {
private final Gfo_url_parser_fxt tstr = new Gfo_url_parser_fxt();
private final Gfo_url_parser_fxt tstr = new Gfo_url_parser_fxt();
@Test public void Protocol__relative() {
tstr.Exec__parse("//en.wikipedia.org").Test__protocol_tid(Gfo_protocol_itm.Tid_relative_1).Test__protocol_bry("//").Test__site("en.wikipedia.org");
}

View File

@@ -1,23 +1,23 @@
/*
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.core.net; import gplx.*; import gplx.core.*;
import gplx.core.ios.*; import gplx.core.ios.streams.*;
import java.io.*;
class Http_client_wtr__stream implements Http_client_wtr {
private final byte[] tmp_stream_bry = new byte[1024];
private final byte[] tmp_stream_bry = new byte[1024];
private DataOutputStream stream;
public void Stream_(Object o) {
this.stream = new DataOutputStream((OutputStream)o);

View File

@@ -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.core.net; import gplx.*; import gplx.core.*;
import gplx.core.primitives.*; import gplx.core.btries.*;
public class Http_request_parser {
@@ -22,8 +22,8 @@ public class Http_request_parser {
accept_encoding, x_requested_with, cookie, referer, content_type,
content_type_boundary, connection, pragma, cache_control, origin;
private Http_post_data_hash post_data_hash;
private final Bry_bfr tmp_bfr = Bry_bfr_.New_w_size(255); private final Btrie_rv trv = new Btrie_rv();
private final Http_server_wtr server_wtr; private final boolean log;
private final Bry_bfr tmp_bfr = Bry_bfr_.New_w_size(255); private final Btrie_rv trv = new Btrie_rv();
private final Http_server_wtr server_wtr; private final boolean log;
public Http_request_parser(Http_server_wtr server_wtr, boolean log) {this.server_wtr = server_wtr; this.log = log;}
public void Clear() {
this.dnt = false;
@@ -161,7 +161,7 @@ public class Http_request_parser {
private static final int Tid_get = 1, Tid_post = 2, Tid_host = 3, Tid_user_agent = 4, Tid_accept = 5, Tid_accept_language = 6, Tid_accept_encoding = 7, Tid_dnt = 8
, Tid_x_requested_with = 9, Tid_cookie = 10, Tid_referer = 11, Tid_content_length = 12, Tid_content_type = 13, Tid_connection = 14, Tid_pragma = 15, Tid_cache_control = 16
, Tid_origin = 17, Tid_accept_charset = 188, Tid_upgrade_request = 19, Tid_x_host = 20, Tid_x_real_ip = 21, Tid_sec_fetch_mode = 22, Tid_sec_fetch_site = 23;
private static final Btrie_slim_mgr trie = Btrie_slim_mgr.ci_a7()
private static final Btrie_slim_mgr trie = Btrie_slim_mgr.ci_a7()
.Add_str_int("GET" , Tid_get)
.Add_str_int("POST" , Tid_post)
.Add_str_int("Host:" , Tid_host)
@@ -186,7 +186,7 @@ public class Http_request_parser {
.Add_str_int("Sec-Fetch-Mode:" , Tid_sec_fetch_mode)
.Add_str_int("Sec-Fetch-Site:" , Tid_sec_fetch_site)
;
private static final byte[] Tkn_boundary = Bry_.new_a7("boundary="), Tkn_content_type_boundary_end = Bry_.new_a7("--")
private static final byte[] Tkn_boundary = Bry_.new_a7("boundary="), Tkn_content_type_boundary_end = Bry_.new_a7("--")
, Tkn_content_disposition = Bry_.new_a7("Content-Disposition:"), Tkn_form_data = Bry_.new_a7("form-data;")
, Tkn_name = Bry_.new_a7("name=")
;

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.net; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*;
public class Http_request_parser_tst {
@Before public void init() {fxt.Clear();} private final Http_request_parser_fxt fxt = new Http_request_parser_fxt();
@Before public void init() {fxt.Clear();} private final Http_request_parser_fxt fxt = new Http_request_parser_fxt();
@Test public void Type_post() {
fxt.Test_type_post("POST /url HTTP/1.1", Http_request_itm.Type_post, "/url", "HTTP/1.1");
}
@@ -53,9 +53,9 @@ public class Http_request_parser_tst {
}
}
class Http_request_parser_fxt {
private final Http_request_parser parser;
private final Http_client_rdr client_rdr = Http_client_rdr_.new_mem();
private final Http_server_wtr__mock server_wtr = new Http_server_wtr__mock();
private final Http_request_parser parser;
private final Http_client_rdr client_rdr = Http_client_rdr_.new_mem();
private final Http_server_wtr__mock server_wtr = new Http_server_wtr__mock();
public Http_request_parser_fxt() {
this.parser = new Http_request_parser(server_wtr, false);
}

View File

@@ -13,8 +13,8 @@ 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.core.net; import gplx.*; import gplx.core.*;
public class Http_server_wtr_ {
public static Http_server_wtr New__console() {return new Http_server_wtr__console();}
public static final Http_server_wtr Noop = new Http_server_wtr__noop();
}
package gplx.core.net; import gplx.*; import gplx.core.*;
public class Http_server_wtr_ {
public static Http_server_wtr New__console() {return new Http_server_wtr__console();}
public static final Http_server_wtr Noop = new Http_server_wtr__noop();
}

View File

@@ -13,15 +13,15 @@ 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.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
public class Gfo_qarg_enum_itm {
private final Hash_adp_bry hash = Hash_adp_bry.cs();
public Gfo_qarg_enum_itm(String key) {this.key = Bry_.new_u8(key);}
public Gfo_qarg_enum_itm(byte[] key) {this.key = key;}
public byte[] Key() {return key;} private final byte[] key;
public Gfo_qarg_enum_itm Add(String key, int val) {
hash.Add_bry_int(Bry_.new_u8(key), val);
return this;
}
public int Get_as_int_or(byte[] val, int or) {return hash.Get_as_int_or(val, or);}
}
package gplx.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
public class Gfo_qarg_enum_itm {
private final Hash_adp_bry hash = Hash_adp_bry.cs();
public Gfo_qarg_enum_itm(String key) {this.key = Bry_.new_u8(key);}
public Gfo_qarg_enum_itm(byte[] key) {this.key = key;}
public byte[] Key() {return key;} private final byte[] key;
public Gfo_qarg_enum_itm Add(String key, int val) {
hash.Add_bry_int(Bry_.new_u8(key), val);
return this;
}
public int Get_as_int_or(byte[] val, int or) {return hash.Get_as_int_or(val, or);}
}

View File

@@ -13,15 +13,15 @@ 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.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
public class Gfo_qarg_enum_mgr {
private final Hash_adp_bry hash = Hash_adp_bry.cs();
public Gfo_qarg_enum_mgr(Gfo_qarg_enum_itm... ary) {
int len = ary.length;
for (int i = 0; i < len; ++i) {
Gfo_qarg_enum_itm itm = ary[i];
hash.Add_bry_obj(itm.Key(), itm);
}
}
public Gfo_qarg_enum_itm Get(byte[] key) {return (Gfo_qarg_enum_itm)hash.Get_by_bry(key);}
}
package gplx.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
public class Gfo_qarg_enum_mgr {
private final Hash_adp_bry hash = Hash_adp_bry.cs();
public Gfo_qarg_enum_mgr(Gfo_qarg_enum_itm... ary) {
int len = ary.length;
for (int i = 0; i < len; ++i) {
Gfo_qarg_enum_itm itm = ary[i];
hash.Add_bry_obj(itm.Key(), itm);
}
}
public Gfo_qarg_enum_itm Get(byte[] key) {return (Gfo_qarg_enum_itm)hash.Get_by_bry(key);}
}

View File

@@ -13,15 +13,15 @@ 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.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
public class Gfo_qarg_itm {
public Gfo_qarg_itm(byte[] key_bry, byte[] val_bry) {
this.key_bry = key_bry;
this.val_bry = val_bry;
}
public byte[] Key_bry() {return key_bry;} private final byte[] key_bry;
public byte[] Val_bry() {return val_bry;} private byte[] val_bry;
public void Val_bry_(byte[] v) {val_bry = v;}
public static final Gfo_qarg_itm[] Ary_empty = new Gfo_qarg_itm[0];
}
package gplx.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
public class Gfo_qarg_itm {
public Gfo_qarg_itm(byte[] key_bry, byte[] val_bry) {
this.key_bry = key_bry;
this.val_bry = val_bry;
}
public byte[] Key_bry() {return key_bry;} private final byte[] key_bry;
public byte[] Val_bry() {return val_bry;} private byte[] val_bry;
public void Val_bry_(byte[] v) {val_bry = v;}
public static final Gfo_qarg_itm[] Ary_empty = new Gfo_qarg_itm[0];
}

View File

@@ -1,21 +1,21 @@
/*
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.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
public class Gfo_qarg_mgr {
private final Hash_adp_bry hash = Hash_adp_bry.cs();
private final Hash_adp_bry hash = Hash_adp_bry.cs();
public Gfo_qarg_mgr Init(Gfo_qarg_itm[] args) {
hash.Clear();
int len = args.length;

View File

@@ -1,23 +1,23 @@
/*
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.core.net.qargs; import gplx.*; import gplx.core.*; import gplx.core.net.*;
import gplx.langs.htmls.encoders.*;
public class Gfo_qarg_mgr_old {
private final List_adp list = List_adp_.New();
private final Hash_adp hash = Hash_adp_bry.cs();
private final List_adp list = List_adp_.New();
private final Hash_adp hash = Hash_adp_bry.cs();
public int Len() {return list.Count();}
public boolean Match(byte[] key, byte[] val) {
Gfo_qarg_itm arg = (Gfo_qarg_itm)hash.Get_by(key);

View File

@@ -1,21 +1,21 @@
/*
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.core.primitives; import gplx.*; import gplx.core.*;
public class Bool_ary_bldr {
private final boolean[] ary;
private final boolean[] ary;
public Bool_ary_bldr(int len) {
this.ary = new boolean[len];
}

View File

@@ -1,22 +1,22 @@
/*
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.core.primitives; import gplx.*; import gplx.core.*;
import gplx.core.brys.*;
public class Bry_cache {
private final Hash_adp hash = Hash_adp_.New(); private final Bry_obj_ref hash_ref = Bry_obj_ref.New_empty();
private final Hash_adp hash = Hash_adp_.New(); private final Bry_obj_ref hash_ref = Bry_obj_ref.New_empty();
public byte[] Get_or_new(String v) {return Get_or_new(Bry_.new_u8(v));}
public byte[] Get_or_new(byte[] v) {
if (v.length == 0) return Bry_.Empty;
@@ -29,5 +29,5 @@ public class Bry_cache {
else
return ((Bry_obj_ref)rv).Val();
}
public static final Bry_cache Instance = new Bry_cache(); Bry_cache() {}
public static final Bry_cache Instance = new Bry_cache(); Bry_cache() {}
}

View File

@@ -13,15 +13,15 @@ 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.core.primitives; import gplx.*; import gplx.core.*;
public class Hash_adp__primitive {
private final Hash_adp hash = Hash_adp_.New();
public byte Get_by_str_or_max(String key) {
Byte_obj_val rv = (Byte_obj_val)hash.Get_by(key);
return rv == null ? Byte_.Max_value_127 : rv.Val();
}
public Hash_adp__primitive Add_byte(String key, byte val) {
hash.Add(key, Byte_obj_val.new_(val));
return this;
}
}
package gplx.core.primitives; import gplx.*; import gplx.core.*;
public class Hash_adp__primitive {
private final Hash_adp hash = Hash_adp_.New();
public byte Get_by_str_or_max(String key) {
Byte_obj_val rv = (Byte_obj_val)hash.Get_by(key);
return rv == null ? Byte_.Max_value_127 : rv.Val();
}
public Hash_adp__primitive Add_byte(String key, byte val) {
hash.Add(key, Byte_obj_val.new_(val));
return this;
}
}

View File

@@ -1,25 +1,25 @@
/*
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.core.primitives; import gplx.*; import gplx.core.*;
public class Int_2_val {
public Int_2_val(int v0, int v1) {val_0 = v0; val_1 = v1;}
public int Val_0() {return val_0;} final int val_0;
public int Val_1() {return val_1;} final int val_1;
public int Val_0() {return val_0;} final int val_0;
public int Val_1() {return val_1;} final int val_1;
public String Xto_str(Bry_bfr bfr) {return Xto_str(bfr, val_0, val_1);}
public static final Int_2_val Null_ptr = null;
public static final Int_2_val Null_ptr = null;
public static Int_2_val parse(String raw) {
String[] itms = String_.Split(raw, ',');
if (itms.length != 2) return Null_ptr;

View File

@@ -1,21 +1,21 @@
/*
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.core.primitives; import gplx.*; import gplx.core.*;
public class Int_ary_parser extends Obj_ary_parser_base {
private final Gfo_number_parser parser = new Gfo_number_parser();
private final Gfo_number_parser parser = new Gfo_number_parser();
private int[] ary; private int ary_idx;
public int[] Parse_ary(String str, byte dlm) {byte[] bry = Bry_.new_u8(str); return Parse_ary(bry, 0, bry.length, dlm);}
public int[] Parse_ary(byte[] bry, int bgn, int end, byte dlm) {

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.core.primitives; import gplx.*; import gplx.core.*;
import org.junit.*; import gplx.core.tests.*;
public class Int_ary_parser_tst {
private final Int_ary_parser_fxt fxt = new Int_ary_parser_fxt();
private final Int_ary_parser_fxt fxt = new Int_ary_parser_fxt();
@Test public void Many() {fxt.Test__Parse_ary("1,2,3,4,5" , 0, 9, Int_ary_.New(1, 2, 3, 4, 5));}
@Test public void One() {fxt.Test__Parse_ary("1" , 0, 1, Int_ary_.New(1));}
@Test public void None() {fxt.Test__Parse_ary("" , 0, 0, Int_ary_.New());}

View File

@@ -1,22 +1,22 @@
/*
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.core.primitives; import gplx.*; import gplx.core.*;
public class Int_pool {
private final List_adp available_list = List_adp_.New(); private int available_len;
// private final Bry_bfr dbg_bfr = Bry_bfr_.New();
private final List_adp available_list = List_adp_.New(); private int available_len;
// private final Bry_bfr dbg_bfr = Bry_bfr_.New();
private int uid_max = -1;
public void Clear() {
synchronized (available_list) {

View File

@@ -1,22 +1,22 @@
/*
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.core.progs.rates; import gplx.*; import gplx.core.*; import gplx.core.progs.*;
import gplx.core.lists.rings.*;
public class Gfo_rate_list {
private final Ring__long ring;
private final Ring__long ring;
public Gfo_rate_list(int size) {
this.ring = new Ring__long(size * 2); // *2 to store both data and time
}

View File

@@ -1,22 +1,22 @@
/*
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.core.progs.rates; import gplx.*; import gplx.core.*; import gplx.core.progs.*;
import org.junit.*; import gplx.core.tests.*;
public class Gfo_rate_list_tst {
private final Gfo_rate_list_fxt fxt = new Gfo_rate_list_fxt();
private final Gfo_rate_list_fxt fxt = new Gfo_rate_list_fxt();
@Before public void init() {fxt.Clear();}
@Test public void Add__1() {fxt.Add(100, 20).Test(5, 5);}
@Test public void Add__2() {fxt.Add(100, 20).Add(100, 30).Test(4, .20d);}
@@ -24,7 +24,7 @@ public class Gfo_rate_list_tst {
@Test public void Add__4() {fxt.Add(100, 20).Add(100, 30).Add(100, 50).Add(600, 0).Test(9, 2);}
}
class Gfo_rate_list_fxt {
private final Gfo_rate_list list = new Gfo_rate_list(6);
private final Gfo_rate_list list = new Gfo_rate_list(6);
public void Clear() {list.Clear();}
public Gfo_rate_list_fxt Add(long data, long time) {list.Add(data, time); return this;}
public void Test(double expd_rate, double expd_delta) {

View File

@@ -1,22 +1,22 @@
/*
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.core.progs.rates; import gplx.*; import gplx.core.*; import gplx.core.progs.*;
public class Gfo_rate_mgr {
private final Hash_adp hash = Hash_adp_.New();
private final int dflt_size;
private final Hash_adp hash = Hash_adp_.New();
private final int dflt_size;
public Gfo_rate_mgr(int dflt_size) {this.dflt_size = dflt_size;}
public void Clear() {hash.Clear();}
public int Len() {return hash.Count();}

View File

@@ -13,18 +13,18 @@ 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.core.security.algos.bouncy_castle; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
public class Bouncy_castle_factory implements Hash_algo_factory {
public Hash_algo New_hash_algo(String key) {
return new Bouncy_castle_algo(key);
}
public static String
Key__md2 = "md2", Key__md4 = "md4", Key__md5 = "md5"
, Key__sha1 = "sha1", Key__sha224 = "sha224", Key__sha256 = "sha256", Key__sha384 = "sha384"
, Key__sha_512_224 = "sha-512/224", Key__sha_512_256 = "sha-512/256", Key__sha512 = "sha512"
, Key__sha3_224 = "sha3-224", Key__sha3_256 = "sha3-256", Key__sha3_384 = "sha3-384", Key__sha3_512 = "sha3-512"
, Key__ripemd128 = "ripemd128", Key__ripemd160 = "ripemd160", Key__ripemd256 = "ripemd256", Key__ripemd320 = "ripemd320"
, Key__whirlpool = "whirlpool"
;
public static final Bouncy_castle_factory Instance = new Bouncy_castle_factory(); Bouncy_castle_factory() {}
}
package gplx.core.security.algos.bouncy_castle; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
public class Bouncy_castle_factory implements Hash_algo_factory {
public Hash_algo New_hash_algo(String key) {
return new Bouncy_castle_algo(key);
}
public static String
Key__md2 = "md2", Key__md4 = "md4", Key__md5 = "md5"
, Key__sha1 = "sha1", Key__sha224 = "sha224", Key__sha256 = "sha256", Key__sha384 = "sha384"
, Key__sha_512_224 = "sha-512/224", Key__sha_512_256 = "sha-512/256", Key__sha512 = "sha512"
, Key__sha3_224 = "sha3-224", Key__sha3_256 = "sha3-256", Key__sha3_384 = "sha3-384", Key__sha3_512 = "sha3-512"
, Key__ripemd128 = "ripemd128", Key__ripemd160 = "ripemd160", Key__ripemd256 = "ripemd256", Key__ripemd320 = "ripemd320"
, Key__whirlpool = "whirlpool"
;
public static final Bouncy_castle_factory Instance = new Bouncy_castle_factory(); Bouncy_castle_factory() {}
}

View File

@@ -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.core.security.algos.getopt; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
import org.getopt.util.hash.*;
public class Getopt_factory implements Hash_algo_factory {
@@ -29,5 +29,5 @@ public class Getopt_factory implements Hash_algo_factory {
public static String
Key__fnv132 = "fnv132", Key__fnv164 = "fnv164", Key__fnv1a32 = "fnv1a32", Key__fnv1a64 = "fnv1a64"
;
public static final Getopt_factory Instance = new Getopt_factory(); Getopt_factory() {}
public static final Getopt_factory Instance = new Getopt_factory(); Getopt_factory() {}
}

View File

@@ -1,23 +1,23 @@
/*
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.core.security.algos.gnu_crypto; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
import gnu.crypto.hash.Haval;
import gnu.crypto.hash.Tiger;
public class Gnu_haval_algo implements Hash_algo {
private final Gnu_haval_factory factory;
private final Gnu_haval_factory factory;
private final Haval haval;
public Gnu_haval_algo(Gnu_haval_factory factory, String key) {
this.factory = factory;

View File

@@ -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.core.security.algos.gnu_crypto; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
import gnu.crypto.hash.Haval;
public class Gnu_haval_factory implements Hash_algo_factory {
@@ -48,5 +48,5 @@ public class Gnu_haval_factory implements Hash_algo_factory {
, Key__haval128_4 = "haval128,4", Key__haval160_4 = "haval160,4", Key__haval192_4 = "haval192,4", Key__haval224_4 = "haval224,4", Key__haval256_4 = "haval256,4"
, Key__haval128_5 = "haval128,5", Key__haval160_5 = "haval160,5", Key__haval192_5 = "haval192,5", Key__haval224_5 = "haval224,5", Key__haval256_5 = "haval256,5"
;
public static final Gnu_haval_factory Instance = new Gnu_haval_factory(); Gnu_haval_factory() {}
public static final Gnu_haval_factory Instance = new Gnu_haval_factory(); Gnu_haval_factory() {}
}

View File

@@ -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.core.security.algos.jacksum; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
import gplx.core.encoders.*;
import java.security.NoSuchAlgorithmException;
@@ -28,7 +28,7 @@ public class Jacksum_algo implements Hash_algo {
throw Err_.new_wo_type("jacksum algo doesn't exist: key=" + key);
}
}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public Hash_algo Clone_hash_algo() {return new Jacksum_algo(key);}
public void Update_digest(byte[] bry, int bgn, int end) {checksum.update(bry, bgn, end - bgn);}
public byte[] To_hash_bry() {

View File

@@ -13,17 +13,17 @@ 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.core.security.algos.jacksum; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
public class Jacksum_factory implements Hash_algo_factory {
public Hash_algo New_hash_algo(String key) {
return new Jacksum_algo(key);
}
public Object New_Checksum(String key) {
return null;
}
public static String // REF: /source/jonelo/jacksum/JacksumAPI.java
Key__tiger_128 = "tiger-128", Key__tiger_160 = "tiger-160", Key__tiger_192= "tiger-192", Key__gost = "gost"
;
public static final Jacksum_factory Instance = new Jacksum_factory(); Jacksum_factory() {}
}
package gplx.core.security.algos.jacksum; import gplx.*; import gplx.core.*; import gplx.core.security.*; import gplx.core.security.algos.*;
public class Jacksum_factory implements Hash_algo_factory {
public Hash_algo New_hash_algo(String key) {
return new Jacksum_algo(key);
}
public Object New_Checksum(String key) {
return null;
}
public static String // REF: /source/jonelo/jacksum/JacksumAPI.java
Key__tiger_128 = "tiger-128", Key__tiger_160 = "tiger-160", Key__tiger_192= "tiger-192", Key__gost = "gost"
;
public static final Jacksum_factory Instance = new Jacksum_factory(); Jacksum_factory() {}
}

View File

@@ -13,17 +13,17 @@ 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.core.security.files; import gplx.*; import gplx.core.*; import gplx.core.security.*;
public class Cksum_itm implements gplx.core.brys.Bry_bfr_able {
public Cksum_itm(byte[] hash, Io_url file_url, long file_size) {
this.Hash = hash; this.File_url = file_url; this.File_size = file_size;
}
public final byte[] Hash;
public final Io_url File_url;
public final long File_size;
public void To_bfr(Bry_bfr bfr) {
bfr.Add(Hash).Add_byte_pipe();
bfr.Add_str_u8(File_url.Raw()).Add_byte_pipe();
bfr.Add_long_variable(File_size);
}
}
package gplx.core.security.files; import gplx.*; import gplx.core.*; import gplx.core.security.*;
public class Cksum_itm implements gplx.core.brys.Bry_bfr_able {
public Cksum_itm(byte[] hash, Io_url file_url, long file_size) {
this.Hash = hash; this.File_url = file_url; this.File_size = file_size;
}
public final byte[] Hash;
public final Io_url File_url;
public final long File_size;
public void To_bfr(Bry_bfr bfr) {
bfr.Add(Hash).Add_byte_pipe();
bfr.Add_str_u8(File_url.Raw()).Add_byte_pipe();
bfr.Add_long_variable(File_size);
}
}

View File

@@ -1,26 +1,26 @@
/*
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.core.security.files; import gplx.*; import gplx.core.*; import gplx.core.security.*;
import gplx.core.security.algos.*;
public class Cksum_list {
public Cksum_list(byte type, Cksum_itm[] itms, long itms_size) {
this.Type = type; this.Itms = itms; this.Itms_size = itms_size;
}
public final byte Type;
public final Cksum_itm[] Itms;
public final byte Type;
public final Cksum_itm[] Itms;
public long Itms_size;
public Io_url[] Itms_ary() {
int len = Itms.length;

View File

@@ -1,23 +1,23 @@
/*
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.core.security.files; import gplx.*; import gplx.core.*; import gplx.core.security.*;
import org.junit.*; import gplx.core.tests.*;
import gplx.core.security.algos.*;
public class Cksum_list_tst {
private final Cksum_list_fxt fxt = new Cksum_list_fxt();
private final Cksum_list_fxt fxt = new Cksum_list_fxt();
@Test public void Basic() {
fxt.Init__file("a.txt").Init__file("ab.txt");
fxt.Test__parse(String_.Concat_lines_nl_skip_last
@@ -30,7 +30,7 @@ public class Cksum_list_tst {
}
}
class Cksum_list_fxt {
private final Io_url dir = Io_url_.mem_dir_("mem/dir/");
private final Io_url dir = Io_url_.mem_dir_("mem/dir/");
public Cksum_list_fxt() {
Io_mgr.Instance.InitEngine_mem();
}

View File

@@ -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.core.tests; import gplx.*; import gplx.core.*;
import gplx.core.strings.*;
public class Tst_mgr {
@@ -105,7 +105,7 @@ public class Tst_mgr {
return sb.To_str_and_clear();
}
int Max(int max, String s) {int len = String_.Len(s); return len > max ? len : max;}
public static final Tst_chkr Null_chkr = new Tst_chkr_null();
public static final Tst_chkr Null_chkr = new Tst_chkr_null();
}
class Tst_itm {
public boolean Pass() {return pass;} private boolean pass;

View File

@@ -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.core.threads; import gplx.*; import gplx.core.*;
public class Gfo_async_cmd_itm implements Gfo_invk {
private Gfo_invk invk; private String invk_key; private GfoMsg msg = GfoMsg_.new_cast_("");
@@ -36,5 +36,5 @@ public class Gfo_async_cmd_itm implements Gfo_invk {
else return Gfo_invk_.Rv_unhandled;
return this;
} private static final String Invk_exec = "exec";
public static final Gfo_async_cmd_itm[] Ary_empty = new Gfo_async_cmd_itm[0];
public static final Gfo_async_cmd_itm[] Ary_empty = new Gfo_async_cmd_itm[0];
}

View File

@@ -1,25 +1,25 @@
/*
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.core.threads; import gplx.*; import gplx.core.*;
public class Gfo_thread_grp implements Gfo_invk {
private final Object thread_lock = new Object();
private final List_adp list = List_adp_.New();
private final Object thread_lock = new Object();
private final List_adp list = List_adp_.New();
private int active_cur;
public Gfo_thread_grp(String key) {this.key = key;}
public String Key() {return key;} private final String key;
public String Key() {return key;} private final String key;
public boolean Autorun() {return autorun;} public Gfo_thread_grp Autorun_(boolean v) {autorun = v; return this;} private boolean autorun = true;
public int Active_max() {return active_max;} public Gfo_thread_grp Active_max_(int v) {active_max = v; return this;} private int active_max = 1;
public void Add(Gfo_thread_itm... ary) {

View File

@@ -1,21 +1,21 @@
/*
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.core.threads; import gplx.*; import gplx.core.*;
public class Gfo_thread_mgr {
private final Ordered_hash hash = Ordered_hash_.New();
private final Ordered_hash hash = Ordered_hash_.New();
public Gfo_thread_grp Get_by_or_new(String k) {
Gfo_thread_grp rv = (Gfo_thread_grp)hash.Get_by(k);
if (rv == null) {

View File

@@ -1,23 +1,23 @@
/*
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.dbs; import gplx.*;
import gplx.dbs.metas.*; import gplx.dbs.sqls.*; import gplx.dbs.sqls.wtrs.*;
class Db_diff_bldr {
private final Bry_bfr bfr = Bry_bfr_.New();
private final Sql_schema_wtr sql_bldr = new Sql_schema_wtr();
private final Bry_bfr bfr = Bry_bfr_.New();
private final Sql_schema_wtr sql_bldr = new Sql_schema_wtr();
public Db_diff_bldr() {sql_bldr.Bfr_(bfr);}
public String Compare_db(String src_str, String trg_str) {
// Io_url src_url = Io_url_.new_fil_(src_str);

View File

@@ -1,23 +1,23 @@
/*
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.dbs.bulks; import gplx.*; import gplx.dbs.*;
import gplx.dbs.*; import gplx.dbs.metas.*;
public class Db_tbl_copy {
private final Bry_bfr bfr = Bry_bfr_.New();
private final Db_attach_mgr attach_mgr = new Db_attach_mgr();
private final Bry_bfr bfr = Bry_bfr_.New();
private final Db_attach_mgr attach_mgr = new Db_attach_mgr();
public void Copy_many(Db_conn src_conn, Db_conn trg_conn, String... tbl_names) {
for (String tbl_name : tbl_names)
Copy_one(src_conn, trg_conn, tbl_name, tbl_name);

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.dbs.bulks; import gplx.*; import gplx.dbs.*;
import org.junit.*; import gplx.core.tests.*; import gplx.dbs.metas.*;
public class Db_tbl_copy_tst {
private final Db_tbl_copy_fxt fxt = new Db_tbl_copy_fxt();
private final Db_tbl_copy_fxt fxt = new Db_tbl_copy_fxt();
@Test public void Basic() {
fxt.Test__bld_sql(fxt.Make_tbl("tbl_1", Dbmeta_fld_itm.new_int("fld_1"), Dbmeta_fld_itm.new_int("fld_2")),
String_.Concat_lines_nl_skip_last
@@ -29,7 +29,7 @@ public class Db_tbl_copy_tst {
}
}
class Db_tbl_copy_fxt {
private final Db_tbl_copy mgr = new Db_tbl_copy();
private final Db_tbl_copy mgr = new Db_tbl_copy();
public Dbmeta_tbl_itm Make_tbl(String name, Dbmeta_fld_itm... flds) {return Dbmeta_tbl_itm.New(name, flds);}
public void Test__bld_sql(Dbmeta_tbl_itm tbl, String expd) {
Gftest.Eq__ary__lines(expd, mgr.Bld_sql(tbl, "src", "trg"), "sql");

View File

@@ -1,21 +1,21 @@
/*
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.dbs.cfgs; import gplx.*; import gplx.dbs.*;
public class Db_cfg_hash {
private final String grp; private final Ordered_hash hash = Ordered_hash_.New();
private final String grp; private final Ordered_hash hash = Ordered_hash_.New();
public Db_cfg_hash(String grp) {this.grp = grp;}
public int Len() {return hash.Count();}
public Db_cfg_itm Get_at(int i) {return (Db_cfg_itm)hash.Get_at(i);}

View File

@@ -1,23 +1,23 @@
/*
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.dbs.cfgs; import gplx.*; import gplx.dbs.*;
public class Db_cfg_itm {
public Db_cfg_itm(String grp, String key, String val) {this.grp = grp; this.key = key; this.val = val;}
public String Grp() {return grp;} private final String grp;
public String Key() {return key;} private final String key;
public String Grp() {return grp;} private final String grp;
public String Key() {return key;} private final String key;
public String Val() {return val;} public Db_cfg_itm Val_(String v) {val = v; return this;} private String val;
public String To_str_or(String or) {return val == null ? or : val;}
public byte[] To_bry_or(byte[] or) {try {return val == null ? or : Bry_.new_u8(val) ;} catch (Exception e) {throw err_parse(e, Bry_.Cls_val_name);}}
@@ -51,5 +51,5 @@ public class Db_cfg_itm {
public static Db_cfg_itm new_DateAdp (String grp, String key, DateAdp val) {return new Db_cfg_itm(grp , key, val.XtoStr_fmt_yyyyMMdd_HHmmss());}
public static Db_cfg_itm new_guid (String key, Guid_adp val) {return new Db_cfg_itm(Grp_none , key, val.To_str());}
public static Db_cfg_itm new_guid (String grp, String key, Guid_adp val) {return new Db_cfg_itm(grp , key, val.To_str());}
public static final Db_cfg_itm Empty = new Db_cfg_itm("empty", "empty", null);
public static final Db_cfg_itm Empty = new Db_cfg_itm("empty", "empty", null);
}

View File

@@ -1,25 +1,25 @@
/*
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.dbs.cfgs; import gplx.*; import gplx.dbs.*;
import gplx.core.primitives.*;
public class Db_cfg_tbl implements Db_tbl {
private final String tbl_name; private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
private final String fld_grp, fld_key, fld_val;
private final String tbl_name; private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
private final String fld_grp, fld_key, fld_val;
private Db_stmt stmt_insert, stmt_update, stmt_select;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public Db_cfg_tbl(Db_conn conn, String tbl_name) {
this.conn = conn; this.tbl_name = tbl_name;
this.fld_grp = flds.Add_str("cfg_grp", 255);

View File

@@ -13,14 +13,14 @@ 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.dbs.metas; import gplx.*; import gplx.dbs.*;
import gplx.dbs.metas.updates.*;
public class Schema_db_mgr {
public Schema_loader_mgr Loader() {return loader;} public void Loader_(Schema_loader_mgr v) {loader = v;} private Schema_loader_mgr loader;
public Schema_update_mgr Updater() {return updater;} private final Schema_update_mgr updater = new Schema_update_mgr();
public Dbmeta_tbl_mgr Tbl_mgr() {return tbl_mgr;} private final Dbmeta_tbl_mgr tbl_mgr = new Dbmeta_tbl_mgr(Dbmeta_reload_cmd_.Noop);
public void Init(Db_conn conn) {
loader.Load(this, conn);
updater.Update(this, conn);
}
}
package gplx.dbs.metas; import gplx.*; import gplx.dbs.*;
import gplx.dbs.metas.updates.*;
public class Schema_db_mgr {
public Schema_loader_mgr Loader() {return loader;} public void Loader_(Schema_loader_mgr v) {loader = v;} private Schema_loader_mgr loader;
public Schema_update_mgr Updater() {return updater;} private final Schema_update_mgr updater = new Schema_update_mgr();
public Dbmeta_tbl_mgr Tbl_mgr() {return tbl_mgr;} private final Dbmeta_tbl_mgr tbl_mgr = new Dbmeta_tbl_mgr(Dbmeta_reload_cmd_.Noop);
public void Init(Db_conn conn) {
loader.Load(this, conn);
updater.Update(this, conn);
}
}

View File

@@ -1,22 +1,22 @@
/*
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.dbs.percentiles; import gplx.*; import gplx.dbs.*;
class Log_tbl_fmtr {
private final Bry_bfr bfr = Bry_bfr_.New();
private final List_adp itms = List_adp_.New();
private final Bry_bfr bfr = Bry_bfr_.New();
private final List_adp itms = List_adp_.New();
private Log_fld_itm[] ary;
public Log_tbl_fmtr Add_str(String key, int len) {ary = null; itms.Add(new Log_fld_itm__bry(Type_ids_.Id__bry, key, len)); return this;}
public Log_tbl_fmtr Add_int(String key, int bgn, int end) {ary = null; itms.Add(new Log_fld_itm__int(Type_ids_.Id__int, key, bgn, end)); return this;}
@@ -41,8 +41,8 @@ abstract class Log_fld_itm__base implements Log_fld_itm {
public Log_fld_itm__base(int tid, String key, int len) {
this.tid = tid; this.key = key; this.len = len;
}
public int Tid() {return tid;} private final int tid;
public String Key() {return key;} private final String key;
public int Tid() {return tid;} private final int tid;
public String Key() {return key;} private final String key;
public int Len() {return len;} protected int len;
public abstract void Fmt(Bry_bfr bfr, Object val);
}
@@ -62,8 +62,8 @@ class Log_fld_itm__int extends Log_fld_itm__base {
this.bgn = bgn; this.end = end;
this.len = Int_.DigitCount(end);
}
public int Bgn() {return bgn;} private final int bgn;
public int End() {return end;} private final int end;
public int Bgn() {return bgn;} private final int bgn;
public int End() {return end;} private final int end;
@Override public void Fmt(Bry_bfr bfr, Object val) {
int val_int = Int_.Cast(val);
String val_str = String_.PadBgn(Int_.To_str(val_int), this.Len(), " ");

View File

@@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.dbs.percentiles; import gplx.*; import gplx.dbs.*;
import org.junit.*;
public class Percentile_rng_tst {
private final Percentile_rng_fxt fxt = new Percentile_rng_fxt();
private final Percentile_rng_fxt fxt = new Percentile_rng_fxt();
@Before public void init() {fxt.Clear();}
@Test public void Found__000() {
fxt.Test__rng(999994, 1000001);
@@ -37,7 +37,7 @@ public class Percentile_rng_tst {
}
}
class Percentile_rng_fxt {
private final Percentile_rng rng = new Percentile_rng();
private final Percentile_rng rng = new Percentile_rng();
public void Clear() {
this.Exec__init_for_wiki(16000000, 1000000);
this.Exec__init_for_search(100, 0);

View File

@@ -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.dbs.updates; import gplx.*; import gplx.dbs.*;
import gplx.dbs.stmts.*;
/*
@@ -24,7 +24,7 @@ AND page_id < ?
state = -1|100000
*/
public class Sql_runner {
private final Db_stmt_arg_list list = new Db_stmt_arg_list();
private final Db_stmt_arg_list list = new Db_stmt_arg_list();
public Db_conn Conn() {return conn;} public void Conn_(Db_conn v) {conn = v;} private Db_conn conn;
public boolean Quiet() {return quiet;} public void Quiet_(boolean v) {quiet = v;} private boolean quiet;
public String Sql_fmt() {return sql_fmt;} public void Sql_fmt_(String v) {sql_fmt = v;} private String sql_fmt;

View File

@@ -13,14 +13,14 @@ 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.fsdb; import gplx.*;
import gplx.dbs.*; import gplx.dbs.cfgs.*;
public class Fsdb_db_file {
public Fsdb_db_file(Io_url url, Db_conn conn) {
this.url = url; this.conn = conn;
this.tbl__core_cfg = gplx.xowa.wikis.data.Xowd_cfg_tbl_.New(conn);
}
public Io_url Url() {return url;} private final Io_url url;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public Db_cfg_tbl Tbl__cfg() {return tbl__core_cfg;} private final Db_cfg_tbl tbl__core_cfg;
}
package gplx.fsdb; import gplx.*;
import gplx.dbs.*; import gplx.dbs.cfgs.*;
public class Fsdb_db_file {
public Fsdb_db_file(Io_url url, Db_conn conn) {
this.url = url; this.conn = conn;
this.tbl__core_cfg = gplx.xowa.wikis.data.Xowd_cfg_tbl_.New(conn);
}
public Io_url Url() {return url;} private final Io_url url;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public Db_cfg_tbl Tbl__cfg() {return tbl__core_cfg;} private final Db_cfg_tbl tbl__core_cfg;
}

View File

@@ -1,24 +1,24 @@
/*
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.fsdb; import gplx.*;
import gplx.dbs.*; import gplx.dbs.cfgs.*; import gplx.fsdb.meta.*; import gplx.xowa.files.origs.*; import gplx.xowa.wikis.data.*;
public class Fsdb_db_mgr__v2 implements Fsdb_db_mgr {
private final Xow_db_layout layout; private final Io_url wiki_dir;
private final Fsdb_db_file file_main_core, file_user_core;
private final Xof_orig_tbl[] orig_tbl_ary;
private final Xow_db_layout layout; private final Io_url wiki_dir;
private final Fsdb_db_file file_main_core, file_user_core;
private final Xof_orig_tbl[] orig_tbl_ary;
public Fsdb_db_mgr__v2(Xow_db_layout layout, Io_url wiki_dir, Fsdb_db_file file_main_core, Fsdb_db_file file_user_core) {
this.layout = layout; this.wiki_dir = wiki_dir;
this.file_main_core = file_main_core; this.file_user_core = file_user_core;

View File

@@ -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.fsdb.data; import gplx.*; import gplx.fsdb.*;
public class Fsd_bin_itm {
public Fsd_bin_itm(int bin_owner_id, byte bin_owner_tid, int bin_part_id, String bin_data_url, byte[] bin_data) {
@@ -22,11 +22,11 @@ public class Fsd_bin_itm {
this.bin_data_url = bin_data_url;
this.bin_data = bin_data;
}
public int Bin_owner_id() {return bin_owner_id;} private final int bin_owner_id;
public byte Bin_owner_tid() {return bin_owner_tid;} private final byte bin_owner_tid;
public int Bin_part_id() {return bin_part_id;} private final int bin_part_id;
public String Bin_data_url() {return bin_data_url;} private final String bin_data_url;
public byte[] Bin_data() {return bin_data;} private final byte[] bin_data;
public int Bin_owner_id() {return bin_owner_id;} private final int bin_owner_id;
public byte Bin_owner_tid() {return bin_owner_tid;} private final byte bin_owner_tid;
public int Bin_part_id() {return bin_part_id;} private final int bin_part_id;
public String Bin_data_url() {return bin_data_url;} private final String bin_data_url;
public byte[] Bin_data() {return bin_data;} private final byte[] bin_data;
public static final int Db_row_size_fixed = (3 * 4); // bin_owner_id, bin_part_id, bin_owner_tid (assume byte saved as int in SQLITE)
}

View File

@@ -19,9 +19,9 @@ import gplx.dbs.*;
import gplx.core.ios.streams.*;
public class Fsd_bin_tbl implements Rls_able {
public final String fld__owner_id, fld__owner_tid, fld__part_id, fld__data_url, fld__data;
public final String fld__owner_id, fld__owner_tid, fld__part_id, fld__data_url, fld__data;
private Db_conn conn; private Db_stmt stmt_insert, stmt_select, stmt_select_itm; private Bry_bfr tmp_bfr;
private final Bool_obj_ref saved_in_parts = Bool_obj_ref.n_();
private final Bool_obj_ref saved_in_parts = Bool_obj_ref.n_();
public Fsd_bin_tbl(Db_conn conn, boolean schema_is_1) {
this.conn = conn;
fld__owner_id = flds.Add_int_pkey ("bin_owner_id");
@@ -31,8 +31,8 @@ public class Fsd_bin_tbl implements Rls_able {
fld__data = flds.Add_bry ("bin_data"); // mediumblob
conn.Rls_reg(this);
}
public String Tbl_name() {return tbl_name;} private final String tbl_name = "fsdb_bin";
public Dbmeta_fld_list Flds() {return flds;} private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
public String Tbl_name() {return tbl_name;} private final String tbl_name = "fsdb_bin";
public Dbmeta_fld_list Flds() {return flds;} private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
public void Rls() {
stmt_insert = Db_stmt_.Rls(stmt_insert);
stmt_select = Db_stmt_.Rls(stmt_select);

View File

@@ -13,17 +13,17 @@ 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.fsdb.data; import gplx.*; import gplx.fsdb.*;
public class Fsd_dir_itm {
public Fsd_dir_itm(int dir_id, int owner, byte[] name) {
this.dir_id = dir_id;
this.owner = owner;
this.name = name;
}
public int Dir_id() {return dir_id;} private final int dir_id;
public int Owner() {return owner;} private final int owner;
public byte[] Name() {return name;} private final byte[] name;
public static final int Owner_root = 0;
public static final Fsd_dir_itm Null = null;
}
package gplx.fsdb.data; import gplx.*; import gplx.fsdb.*;
public class Fsd_dir_itm {
public Fsd_dir_itm(int dir_id, int owner, byte[] name) {
this.dir_id = dir_id;
this.owner = owner;
this.name = name;
}
public int Dir_id() {return dir_id;} private final int dir_id;
public int Owner() {return owner;} private final int owner;
public byte[] Name() {return name;} private final byte[] name;
public static final int Owner_root = 0;
public static final Fsd_dir_itm Null = null;
}

View File

@@ -1,24 +1,24 @@
/*
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.fsdb.data; import gplx.*; import gplx.fsdb.*;
import gplx.dbs.*;
public class Fsd_dir_tbl implements Db_tbl {
private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
private final String fld_id, fld_owner_id, fld_name;
private final Db_conn conn; private Db_stmt stmt_select_by_name;
private final Dbmeta_fld_list flds = new Dbmeta_fld_list();
private final String fld_id, fld_owner_id, fld_name;
private final Db_conn conn; private Db_stmt stmt_select_by_name;
public Fsd_dir_tbl(Db_conn conn, boolean schema_is_1) {
this.conn = conn;
this.fld_id = flds.Add_int_pkey ("dir_id");
@@ -26,7 +26,7 @@ public class Fsd_dir_tbl implements Db_tbl {
this.fld_name = flds.Add_str ("dir_name", 255);
conn.Rls_reg(this);
}
public String Tbl_name() {return tbl_name;} private final String tbl_name = "fsdb_dir";
public String Tbl_name() {return tbl_name;} private final String tbl_name = "fsdb_dir";
public void Create_tbl() {
conn.Meta_tbl_create
( Dbmeta_tbl_itm.New(tbl_name, flds

View File

@@ -1,34 +1,34 @@
/*
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.fsdb.data; import gplx.*; import gplx.fsdb.*;
public class Fsd_fil_itm {
public Fsd_fil_itm (int mnt_id, int dir_id, int fil_id, int xtn_id, int ext_id, byte[] name, long size, String modified_on, String hash_md5, int bin_db_id) {
this.mnt_id = mnt_id; this.dir_id = dir_id; this.fil_id = fil_id; this.xtn_id = xtn_id; this.ext_id = ext_id;
this.name = name; this.size = size; this.modified_on = modified_on; this.hash_md5 = hash_md5; this.bin_db_id = bin_db_id;
}
public int Mnt_id() {return mnt_id;} private final int mnt_id;
public int Dir_id() {return dir_id;} private final int dir_id;
public int Fil_id() {return fil_id;} private final int fil_id;
public int Xtn_id() {return xtn_id;} private final int xtn_id;
public int Ext_id() {return ext_id;} private final int ext_id;
public byte[] Name() {return name;} private final byte[] name;
public long Size() {return size;} private final long size;
public String Modified_on() {return modified_on;} private final String modified_on;
public String Hash_md5() {return hash_md5;} private final String hash_md5;
public int Bin_db_id() {return bin_db_id;} private final int bin_db_id;
public int Mnt_id() {return mnt_id;} private final int mnt_id;
public int Dir_id() {return dir_id;} private final int dir_id;
public int Fil_id() {return fil_id;} private final int fil_id;
public int Xtn_id() {return xtn_id;} private final int xtn_id;
public int Ext_id() {return ext_id;} private final int ext_id;
public byte[] Name() {return name;} private final byte[] name;
public long Size() {return size;} private final long size;
public String Modified_on() {return modified_on;} private final String modified_on;
public String Hash_md5() {return hash_md5;} private final String hash_md5;
public int Bin_db_id() {return bin_db_id;} private final int bin_db_id;
public int Db_row_size() {return Db_row_size_fixed + name.length;}
private static final int Db_row_size_fixed =
@@ -38,7 +38,7 @@ public class Fsd_fil_itm {
+ 14 // modified_on
;
public static final Fsd_fil_itm Null = null;
public static final Fsd_fil_itm Null = null;
public static byte[] Gen_cache_key(Bry_bfr bfr, int dir_id, byte[] name) {
return bfr.Add_int_variable(dir_id).Add_byte_pipe().Add(name).To_bry_and_clear();
}

View File

@@ -1,25 +1,25 @@
/*
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.fsdb.data; import gplx.*; import gplx.fsdb.*;
import gplx.dbs.*; import gplx.dbs.qrys.*; import gplx.dbs.engines.sqlite.*;
public class Fsd_fil_tbl implements Db_tbl {
public final Dbmeta_fld_list flds = new Dbmeta_fld_list();
public final String fld_id, fld_owner_id, fld_name, fld_xtn_id, fld_ext_id, fld_size, fld_modified, fld_hash, fld_bin_db_id;
private final String idx_owner;
public final Db_conn conn; private Db_stmt stmt_insert, stmt_update, stmt_select_by_name; private int mnt_id;
public final Dbmeta_fld_list flds = new Dbmeta_fld_list();
public final String fld_id, fld_owner_id, fld_name, fld_xtn_id, fld_ext_id, fld_size, fld_modified, fld_hash, fld_bin_db_id;
private final String idx_owner;
public final Db_conn conn; private Db_stmt stmt_insert, stmt_update, stmt_select_by_name; private int mnt_id;
public Fsd_fil_tbl(Db_conn conn, boolean schema_is_1, int mnt_id) {
this.conn = conn; this.mnt_id = mnt_id;
this.fld_id = flds.Add_int_pkey ("fil_id");
@@ -34,7 +34,7 @@ public class Fsd_fil_tbl implements Db_tbl {
this.idx_owner = Dbmeta_idx_itm.Bld_idx_name(tbl_name, "owner");
conn.Rls_reg(this);
}
public String Tbl_name() {return tbl_name;} private final String tbl_name = "fsdb_fil";
public String Tbl_name() {return tbl_name;} private final String tbl_name = "fsdb_fil";
public void Rls() {
stmt_insert = Db_stmt_.Rls(stmt_insert);
stmt_update = Db_stmt_.Rls(stmt_update);

View File

@@ -13,13 +13,13 @@ 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.fsdb.data; import gplx.*; import gplx.fsdb.*;
public class Fsd_img_itm {
public Fsd_img_itm(int mnt_id, int dir_id, int fil_id, int bin_db_id) {
this.mnt_id = mnt_id; this.dir_id = dir_id; this.fil_id = fil_id; this.bin_db_id = bin_db_id;
}
public int Mnt_id() {return mnt_id;} private final int mnt_id;
public int Dir_id() {return dir_id;} private final int dir_id;
public int Fil_id() {return fil_id;} private final int fil_id;
public int Bin_db_id() {return bin_db_id;} private final int bin_db_id;
}
package gplx.fsdb.data; import gplx.*; import gplx.fsdb.*;
public class Fsd_img_itm {
public Fsd_img_itm(int mnt_id, int dir_id, int fil_id, int bin_db_id) {
this.mnt_id = mnt_id; this.dir_id = dir_id; this.fil_id = fil_id; this.bin_db_id = bin_db_id;
}
public int Mnt_id() {return mnt_id;} private final int mnt_id;
public int Dir_id() {return dir_id;} private final int dir_id;
public int Fil_id() {return fil_id;} private final int fil_id;
public int Bin_db_id() {return bin_db_id;} private final int bin_db_id;
}

View File

@@ -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.fsdb.data; import gplx.*; import gplx.fsdb.*;
public class Fsd_thm_itm {
public void Ctor(int mnt_id, int dir_id, int fil_id, int thm_id, int bin_db_id, int w, int h, double time, int page, long size, String modified, String hash) {
@@ -50,8 +50,8 @@ public class Fsd_thm_itm {
+ 14 // modified_on
;
public static final Fsd_thm_itm Null = null;
public static final Fsd_thm_itm[] Ary_empty = new Fsd_thm_itm[0];
public static final Fsd_thm_itm Null = null;
public static final Fsd_thm_itm[] Ary_empty = new Fsd_thm_itm[0];
public static Fsd_thm_itm new_() {return new Fsd_thm_itm();} Fsd_thm_itm() {}
}
class Fsdb_thm_itm_sorter implements gplx.core.lists.ComparerAble {
@@ -62,5 +62,5 @@ class Fsdb_thm_itm_sorter implements gplx.core.lists.ComparerAble {
comp = Double_.Compare (lhs.Time() , rhs.Time()); if (comp != CompareAble_.Same) return comp; // sort by increasing time
return Int_.Compare (lhs.Page() , rhs.Page()); // sort by increasing page
}
public static final Fsdb_thm_itm_sorter Instance = new Fsdb_thm_itm_sorter(); Fsdb_thm_itm_sorter() {}
public static final Fsdb_thm_itm_sorter Instance = new Fsdb_thm_itm_sorter(); Fsdb_thm_itm_sorter() {}
}

View File

@@ -1,24 +1,24 @@
/*
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.fsdb.data; import gplx.*; import gplx.fsdb.*;
import gplx.dbs.*; import gplx.fsdb.meta.*; import gplx.xowa.files.*;
public class Fsd_thm_tbl implements Db_tbl {
public final Dbmeta_fld_list flds = new Dbmeta_fld_list();
public final String fld_id, fld_owner_id, fld_w, fld_h, fld_time, fld_page, fld_bin_db_id, fld_size, fld_modified, fld_hash;
public final Db_conn conn; private Db_stmt stmt_insert, stmt_select_by_fil_exact, stmt_select_by_fil_near; private int mnt_id; private boolean schema_thm_page;
public final Dbmeta_fld_list flds = new Dbmeta_fld_list();
public final String fld_id, fld_owner_id, fld_w, fld_h, fld_time, fld_page, fld_bin_db_id, fld_size, fld_modified, fld_hash;
public final Db_conn conn; private Db_stmt stmt_insert, stmt_select_by_fil_exact, stmt_select_by_fil_near; private int mnt_id; private boolean schema_thm_page;
public Fsd_thm_tbl(Db_conn conn, boolean schema_is_1, int mnt_id, boolean schema_thm_page) {
this.conn = conn; this.mnt_id = mnt_id; this.schema_thm_page = schema_thm_page;
this.tbl_name = schema_is_1 ? "fsdb_xtn_thm" : "fsdb_thm";
@@ -40,7 +40,7 @@ public class Fsd_thm_tbl implements Db_tbl {
this.fld_hash = flds.Add_str ("thm_hash", 40);
conn.Rls_reg(this);
}
public String Tbl_name() {return tbl_name;} private final String tbl_name;
public String Tbl_name() {return tbl_name;} private final String tbl_name;
public void Create_tbl() {
conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds
, Dbmeta_idx_itm.new_unique_by_tbl(tbl_name, "owner", fld_owner_id, fld_id, fld_w, fld_time, fld_page)
@@ -123,7 +123,7 @@ public class Fsd_thm_tbl implements Db_tbl {
itm.Ctor(mnt_id, dir_id, fil_id, thm_id, bin_db_id, w, h, time, page, size, modified, hash);
return true;
}
public static final DateAdp Modified_null = null;
public static final DateAdp Modified_null = null;
public static final String Hash_null = "", Modified_null_str = "";
public static boolean Match_nearest(List_adp list, Fsd_thm_itm thm, boolean schema_thm_page) {
int len = list.Count(); if (len == 0) return Bool_.N;

View File

@@ -32,7 +32,7 @@ public class Fsd_thm_tbl_tst {
}
}
class Fsd_thm_tbl_fxt {
private final List_adp list = List_adp_.New();
private final List_adp list = List_adp_.New();
public void Clear() {list.Clear();}
public Fsd_thm_itm Make(int w) {
double time = gplx.xowa.files.Xof_lnki_time.Null;

View File

@@ -1,25 +1,25 @@
/*
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.fsdb.meta; import gplx.*; import gplx.fsdb.*;
import gplx.core.primitives.*; import gplx.core.caches.*; import gplx.core.ios.*; import gplx.core.ios.streams.*;
import gplx.dbs.*; import gplx.dbs.engines.sqlite.*; import gplx.fsdb.data.*;
public class Fsm_atr_fil {
private final Fsm_mnt_itm mnt_itm; private final int mnt_id;
private final Fsm_mnt_itm mnt_itm; private final int mnt_id;
private Fsd_dir_tbl tbl_dir; private Fsd_fil_tbl tbl_fil; private Fsd_thm_tbl tbl_thm;
private final Gfo_cache_mgr_bry dir_cache = new Gfo_cache_mgr_bry(); private Gfo_cache_mgr_bry fil_cache; private Bry_bfr fil_cache_key_bfr;
private final Gfo_cache_mgr_bry dir_cache = new Gfo_cache_mgr_bry(); private Gfo_cache_mgr_bry fil_cache; private Bry_bfr fil_cache_key_bfr;
public Fsm_atr_fil(Fsm_mnt_itm mnt_itm, int id, String url_rel, Db_conn conn, boolean schema_is_1, boolean schema_thm_page) {
this.mnt_itm = mnt_itm; this.mnt_id = mnt_itm.Id();
this.id = id; this.url_rel = url_rel; this.conn = conn;
@@ -27,9 +27,9 @@ public class Fsm_atr_fil {
this.tbl_fil = new Fsd_fil_tbl(conn, schema_is_1, mnt_id);
this.tbl_thm = new Fsd_thm_tbl(conn, schema_is_1, mnt_id, schema_thm_page);
}
public int Id() {return id;} private final int id;
public String Url_rel() {return url_rel;} private final String url_rel;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public int Id() {return id;} private final int id;
public String Url_rel() {return url_rel;} private final String url_rel;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public Fsd_fil_itm Select_fil_or_null(byte[] dir, byte[] fil) {
int dir_id = Get_dir_id_or_neg1(dir);
return dir_id == Int_.Neg1 ? Fsd_fil_itm.Null : tbl_fil.Select_or_null(dir_id, fil);

View File

@@ -1,24 +1,24 @@
/*
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.fsdb.meta; import gplx.*; import gplx.fsdb.*;
import gplx.dbs.*; import gplx.dbs.qrys.*;
public class Fsm_atr_tbl implements Db_tbl {
public final Dbmeta_fld_list flds = new Dbmeta_fld_list();
private final String fld_uid, fld_url;
private final Db_conn conn;
public final Dbmeta_fld_list flds = new Dbmeta_fld_list();
private final String fld_uid, fld_url;
private final Db_conn conn;
public Fsm_atr_tbl(Db_conn conn, boolean schema_is_1) {
this.conn = conn;
String fld_prefix = "";
@@ -27,7 +27,7 @@ public class Fsm_atr_tbl implements Db_tbl {
this.fld_uid = flds.Add_int_pkey (fld_prefix + "uid");
this.fld_url = flds.Add_str (fld_prefix + "url", 255);
}
public String Tbl_name() {return tbl_name;} private final String tbl_name;
public String Tbl_name() {return tbl_name;} private final String tbl_name;
public void Create_tbl() {conn.Meta_tbl_create(Dbmeta_tbl_itm.New(tbl_name, flds));}
public Fsm_atr_fil Select_1st_or_fail(Fsm_mnt_itm mnt_itm, Fsdb_db_mgr core_mgr, int mnt_id, boolean schema_thm_page) {
Db_rdr rdr = conn.Stmt_select(tbl_name, flds, Dbmeta_fld_itm.Str_ary_empty).Exec_select__rls_auto();

View File

@@ -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.fsdb.meta; import gplx.*; import gplx.fsdb.*;
import gplx.core.ios.*; import gplx.core.ios.streams.*; import gplx.dbs.*;
import gplx.fsdb.data.*;
@@ -21,12 +21,12 @@ public class Fsm_bin_fil {
this.id = id; this.url = url; this.url_rel = url_rel; this.conn = conn; this.bin_len = bin_len;
this.tbl = new Fsd_bin_tbl(conn, schema_is_1);
}
public int Id() {return id;} private final int id;
public int Id() {return id;} private final int id;
public Io_url Url() {return url;} private Io_url url;
public String Url_rel() {return url_rel;} private final String url_rel;
public String Url_rel() {return url_rel;} private final String url_rel;
public long Bin_len() {return bin_len;} public void Bin_len_(long v) {bin_len = v;} private long bin_len;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public Fsd_bin_tbl Tbl() {return tbl;} private final Fsd_bin_tbl tbl;
public Db_conn Conn() {return conn;} private final Db_conn conn;
public Fsd_bin_tbl Tbl() {return tbl;} private final Fsd_bin_tbl tbl;
public boolean Select_to_url(int id, Io_url url) {return tbl.Select_to_url(id, url);}
public Io_stream_rdr Select_as_rdr(int id) {return tbl.Select_as_rdr(id);}
public Fsd_bin_itm Select_as_itm(int id) {return tbl.Select_as_itm(id);}
@@ -34,6 +34,6 @@ public class Fsm_bin_fil {
tbl.Insert_rdr(bin_id, owner_tid, rdr_len, rdr);
Bin_len_(bin_len + rdr_len);
}
public static final Fsm_bin_fil[] Ary_empty = new Fsm_bin_fil[0];
public static final Fsm_bin_fil[] Ary_empty = new Fsm_bin_fil[0];
public static final long Bin_len_null = 0;
}

View File

@@ -1,23 +1,23 @@
/*
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.fsdb.meta; import gplx.*; import gplx.fsdb.*;
import gplx.core.ios.*; import gplx.core.ios.streams.*; import gplx.dbs.*;
public class Fsm_bin_mgr {
private final Fsdb_db_mgr core_mgr; private final int mnt_id; private final Fsm_bin_tbl tbl;
private final Ordered_hash db_hash = Ordered_hash_.New();
private final Fsdb_db_mgr core_mgr; private final int mnt_id; private final Fsm_bin_tbl tbl;
private final Ordered_hash db_hash = Ordered_hash_.New();
private Fsm_bin_fil nth_db;
public Fsm_bin_mgr(Fsdb_db_mgr core_mgr, Db_conn conn, int mnt_id) {
this.core_mgr = core_mgr; this.mnt_id = mnt_id;

Some files were not shown because too many files have changed in this diff Show More