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

v2.11.4.1

This commit is contained in:
gnosygnu
2015-11-22 21:39:33 -05:00
parent 8a5d58a973
commit 097e6c7f80
581 changed files with 2897 additions and 2097 deletions

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*;
public class Bry_comparer_bgn_eos implements gplx.lists.ComparerAble {
public class Bry_comparer_bgn_eos implements gplx.core.lists.ComparerAble {
public Bry_comparer_bgn_eos(int bgn) {this.bgn = bgn;} private int bgn;
public int compare(Object lhsObj, Object rhsObj) {
byte[] lhs = (byte[])lhsObj, rhs = (byte[])rhsObj;

View File

@@ -24,7 +24,7 @@ public class Xowd_hive_mgr {
dir_tid_reg = dir_tid == Xotdb_dir_info_.Tid_page ? Xotdb_dir_info_.Tid_ttl : dir_tid;
} Xowe_wiki wiki; Xotdb_fsys_mgr fsys_mgr; Xowd_regy_mgr reg_mgr; byte dir_tid;
byte dir_tid_reg;
public void Create(Xow_ns ns, byte[] key, byte[] data, gplx.lists.ComparerAble comparer) {
public void Create(Xow_ns ns, byte[] key, byte[] data, gplx.core.lists.ComparerAble comparer) {
if (reg_mgr == null) reg_mgr = new Xowd_regy_mgr(fsys_mgr.Url_ns_reg(ns.Num_str(), dir_tid_reg));
int fil_idx = 0;
if (reg_mgr.Files_ary().length == 0) {
@@ -48,7 +48,7 @@ public class Xowd_hive_mgr {
xdat.Save(url);
reg_mgr.Save();
}
public void Create(byte[] key, byte[] data, gplx.lists.ComparerAble comparer) {
public void Create(byte[] key, byte[] data, gplx.core.lists.ComparerAble comparer) {
if (reg_mgr == null) reg_mgr = new Xowd_regy_mgr(fsys_mgr.Url_site_reg(dir_tid));
int fil_idx = 0;
if (reg_mgr.Files_ary().length == 0) {

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*;
import gplx.lists.*;
import gplx.core.lists.*;
public class Xowd_regy_mgr {
public static final int Not_found = -1;
public Xowd_regy_mgr() {}

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.wikis.tdbs.hives; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*;
public class Xowd_ttl_file_comparer_end implements gplx.lists.ComparerAble {
public class Xowd_ttl_file_comparer_end implements gplx.core.lists.ComparerAble {
public int compare(Object lhsObj, Object rhsObj) {
Xowd_hive_regy_itm lhs = (Xowd_hive_regy_itm)lhsObj, rhs = (Xowd_hive_regy_itm)rhsObj;
if (lhs.Count() == 0) return Bry_.Compare(rhs.End(), lhs.Bgn());

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.wikis.tdbs.stats; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*; import gplx.xowa.wikis.tdbs.*;
import gplx.core.strings.*;
public class Xob_stat_itm implements NewAble {
public class Xob_stat_itm {
public String Ns() {return ns;} private String ns;
public int Fils;
public long Size, SizeMax = Int_.Min_value, SizeMin = Int_.Max_value;

View File

@@ -20,7 +20,14 @@ import gplx.core.strings.*; import gplx.xowa.wikis.tdbs.*;
public class Xob_stat_type {
public byte Tid() {return tid;} private byte tid;
public Xob_stat_type(byte tid) {this.tid = tid;}
public Xob_stat_itm GetOrNew(String ns) {return (Xob_stat_itm)regy.Get_by_or_new(ns, Xob_stat_itm.Instance);}
public Xob_stat_itm GetOrNew(String ns) {
Xob_stat_itm rv = (Xob_stat_itm)regy.Get_by(ns);
if (rv == null) {
rv = new Xob_stat_itm(ns);
regy.Add(ns, rv);
}
return rv;
}
public Xob_stat_itm GetAt(int i) {return (Xob_stat_itm)regy.Get_at(i);}
public int Count() {return regy.Count();}
public void To_str(String_bldr sb) {

View File

@@ -48,7 +48,7 @@ public class Xob_xdat_file {
}
return rv;
}
public void Sort(Bry_bfr bfr, gplx.lists.ComparerAble comparer) {
public void Sort(Bry_bfr bfr, gplx.core.lists.ComparerAble comparer) {
int ary_len = itm_ends.length;
byte[][] brys = Src_extract_brys(ary_len);
Array_.Sort(brys, comparer);

View File

@@ -78,7 +78,7 @@ public class Xob_xdat_file_tst {
Tfds.Eq_str_lines(expd, String_.new_a7(Xob_xdat_file.Rebuid_header(Bry_.new_a7(orig), Bry_.new_a7("\n"))));
}
Bry_bfr tmp = Bry_bfr.new_();
private void tst_Sort(Xob_xdat_file rdr, gplx.lists.ComparerAble comparer, String expd) {
private void tst_Sort(Xob_xdat_file rdr, gplx.core.lists.ComparerAble comparer, String expd) {
rdr.Sort(tmp, comparer);
Chk_file(rdr, expd);
}

View File

@@ -115,8 +115,8 @@ public class Xob_xdat_file_wtr {
private static final byte Dlm_fld = Byte_ascii.Pipe;
}
class SortAlgo_quick {// quicksort
Object[] ary; int ary_len; gplx.lists.ComparerAble comparer;
public void Sort(Object[] ary, int ary_len, gplx.lists.ComparerAble comparer) {
Object[] ary; int ary_len; gplx.core.lists.ComparerAble comparer;
public void Sort(Object[] ary, int ary_len, gplx.core.lists.ComparerAble comparer) {
if (ary == null || ary_len < 2) return;
this.ary = ary; this.ary_len = ary_len; this.comparer = comparer;
Sort_recurse(0, ary_len - 1);