mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
@@ -56,7 +56,7 @@ public class Err extends RuntimeException {
|
||||
String nl_str = called_by_log ? "\t" : "\n";
|
||||
String rv = ""; //nl_str + "----------------------------------------------------------------------" + nl_str;
|
||||
for (int i = 0; i < msgs_idx; ++i) {
|
||||
rv += "[err " + Int_.Xto_str(i) + "] " + msgs_ary[i].To_str() + nl_str;
|
||||
rv += "[err " + Int_.To_str(i) + "] " + msgs_ary[i].To_str() + nl_str;
|
||||
}
|
||||
if (include_trace)
|
||||
rv += "[trace]:" + Trace_to_str(is_gplx, called_by_log, trace_ignore, trace == null ? Err_.Trace_lang(this) : trace);
|
||||
|
||||
@@ -51,7 +51,8 @@ public class Err_ {
|
||||
return new Err(Bool_.Y, Trace_null, Type__gplx, "cast failed", "type", Type_adp_.NameOf_type(t), "obj", o_str);
|
||||
}
|
||||
|
||||
public static String Message_lang(Exception e) {return e.getMessage();}
|
||||
public static String Message_lang(Exception e) {return e.getMessage();}
|
||||
public static String Message_lang_error(Error e) {return e.getMessage();}
|
||||
public static String Trace_lang(Exception e) {return Trace_lang_exec(e.getStackTrace());}
|
||||
public static String Trace_lang(Error e) {return Trace_lang_exec(e.getStackTrace());}
|
||||
private static String Trace_lang_exec(StackTraceElement[] ary) {
|
||||
|
||||
@@ -108,7 +108,7 @@ public class Btrie_fast_mgr {
|
||||
pos = match_pos;
|
||||
}
|
||||
}
|
||||
return dirty ? tmp_bfr.Xto_bry_and_clear() : src;
|
||||
return dirty ? tmp_bfr.To_bry_and_clear() : src;
|
||||
}
|
||||
public static Btrie_fast_mgr cs() {return new Btrie_fast_mgr(Bool_.N);}
|
||||
public static Btrie_fast_mgr ci_a7() {return new Btrie_fast_mgr(Bool_.Y);}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class Btrie_slim_itm {
|
||||
Btrie_slim_itm rv = new Btrie_slim_itm(b, val, case_any);
|
||||
ary[ary_len] = rv;
|
||||
ary_len = new_len;
|
||||
ByteHashItm_sorter._.Sort(ary, ary_len);
|
||||
ByteHashItm_sorter.Instance.Sort(ary, ary_len);
|
||||
return rv;
|
||||
}
|
||||
public void Ary_del(byte b) {
|
||||
@@ -126,5 +126,5 @@ class ByteHashItm_sorter {// quicksort
|
||||
if (lo < j) Sort_recurse(lo, j);
|
||||
if (i < hi) Sort_recurse(i, hi);
|
||||
}
|
||||
public static final ByteHashItm_sorter _ = new ByteHashItm_sorter(); ByteHashItm_sorter() {}
|
||||
public static final ByteHashItm_sorter Instance = new ByteHashItm_sorter(); ByteHashItm_sorter() {}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,12 @@ public class Btrie_slim_mgr implements Btrie_mgr {
|
||||
Btrie_slim_mgr(boolean case_match) {root = new Btrie_slim_itm(Byte_.Zero, null, !case_match);} private Btrie_slim_itm root;
|
||||
public int Count() {return count;} private int count;
|
||||
public int Match_pos() {return match_pos;} private int match_pos;
|
||||
public Object Match_exact(byte[] src) {return src == null ? null : Match_exact(src, 0, src.length);}
|
||||
public Object Match_exact(byte[] src, int bgn_pos, int end_pos) {
|
||||
Object rv = Match_bgn_w_byte(src[bgn_pos], src, bgn_pos, end_pos);
|
||||
return rv == null ? null : match_pos - bgn_pos == end_pos - bgn_pos ? rv : null;
|
||||
}
|
||||
public Object Match_bgn(byte[] src, int bgn_pos, int end_pos) {return Match_bgn_w_byte(src[bgn_pos], src, bgn_pos, end_pos);}
|
||||
public Object Match_bgn(byte[] src, int bgn_pos, int end_pos) {return bgn_pos < end_pos ? Match_bgn_w_byte(src[bgn_pos], src, bgn_pos, end_pos) : null;} // handle out of bounds gracefully; EX: Match_bgn("abc", 3, 3) should return null not fail
|
||||
public Object Match_bgn_w_byte(byte b, byte[] src, int bgn_pos, int src_len) {
|
||||
Object rv = null; int cur_pos = match_pos = bgn_pos;
|
||||
Btrie_slim_itm cur = root;
|
||||
@@ -47,6 +48,7 @@ public class Btrie_slim_mgr implements Btrie_mgr {
|
||||
public Btrie_slim_mgr Add_bry(String key, String val) {return (Btrie_slim_mgr)Add_obj(Bry_.new_u8(key), Bry_.new_u8(val));}
|
||||
public Btrie_slim_mgr Add_bry(String key, byte[] val) {return (Btrie_slim_mgr)Add_obj(Bry_.new_u8(key), val);}
|
||||
public Btrie_slim_mgr Add_bry(byte[] v) {return (Btrie_slim_mgr)Add_obj(v, v);}
|
||||
public Btrie_slim_mgr Add_bry_bry(byte[] key, byte[] val) {return (Btrie_slim_mgr)Add_obj(key, val);}
|
||||
public Btrie_slim_mgr Add_bry_byte(byte b, byte val) {return (Btrie_slim_mgr)Add_obj(new byte[] {b}, Byte_obj_val.new_(val));}
|
||||
public Btrie_slim_mgr Add_bry_byte(byte[] bry, byte val) {return (Btrie_slim_mgr)Add_obj(bry, Byte_obj_val.new_(val));}
|
||||
public Btrie_slim_mgr Add_str_byte__many(byte val, String... ary) {
|
||||
@@ -127,7 +129,7 @@ public class Btrie_slim_mgr implements Btrie_mgr {
|
||||
pos = match_pos;
|
||||
}
|
||||
}
|
||||
return dirty ? tmp_bfr.Xto_bry_and_clear() : src;
|
||||
return dirty ? tmp_bfr.To_bry_and_clear() : src;
|
||||
}
|
||||
public void Clear() {root.Clear(); count = 0;}
|
||||
public static Btrie_slim_mgr cs() {return new Btrie_slim_mgr(Bool_.Y);}
|
||||
|
||||
@@ -62,5 +62,5 @@ public class Console_adp__sys implements Console_adp {
|
||||
catch (java.io.UnsupportedEncodingException e) {throw Err_.new_wo_type("unsupported exception");}
|
||||
ps.println(s);
|
||||
}
|
||||
public static final Console_adp__sys I = new Console_adp__sys();
|
||||
public static final Console_adp__sys Instance = new Console_adp__sys();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Utf8__tst {
|
||||
// bgn = end;
|
||||
// bgn_bry = end_by_codepoint_next;
|
||||
// }
|
||||
// Tfds.WriteText(bfr.Xto_str_and_clear());
|
||||
// Tfds.WriteText(bfr.To_str_and_clear());
|
||||
// }
|
||||
}
|
||||
class Utf8__fxt {
|
||||
|
||||
@@ -21,8 +21,8 @@ public class Js_wtr {
|
||||
private int arg_idx = 0, ary_idx = 0;
|
||||
public byte Quote_char() {return quote_char;} public Js_wtr Quote_char_(byte v) {quote_char = v; return this;} private byte quote_char = Byte_ascii.Quote;
|
||||
public void Clear() {bfr.Clear();}
|
||||
public String To_str() {return bfr.Xto_str();}
|
||||
public String To_str_and_clear() {return bfr.Xto_str_and_clear();}
|
||||
public String To_str() {return bfr.To_str();}
|
||||
public String To_str_and_clear() {return bfr.To_str_and_clear();}
|
||||
public Js_wtr Func_init(String name) {return Func_init(Bry_.new_u8(name));}
|
||||
public Js_wtr Func_init(byte[] name) {
|
||||
bfr.Add(name).Add_byte(Byte_ascii.Paren_bgn);
|
||||
|
||||
@@ -20,7 +20,7 @@ public class Bool_obj_ref {
|
||||
public boolean Val() {return val;} private boolean val;
|
||||
public boolean Val_y() {return val;}
|
||||
public boolean Val_n() {return !val;}
|
||||
public String Val_as_str_yn() {return Yn.Xto_str(val);}
|
||||
public String Val_as_str_yn() {return Yn.To_str(val);}
|
||||
public Bool_obj_ref Val_y_() {val = true; return this;}
|
||||
public Bool_obj_ref Val_n_() {val = false; return this;}
|
||||
public Bool_obj_ref Val_(boolean v) {val = v; return this;}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Byte_obj_ref {
|
||||
public Byte_obj_ref Val_(byte v) {val = v; return this;}
|
||||
@Override public int hashCode() {return val;}
|
||||
@Override public boolean equals(Object obj) {return obj == null ? false : val == ((Byte_obj_ref)obj).Val();}
|
||||
@Override public String toString() {return Int_.Xto_str(val);}
|
||||
@Override public String toString() {return Int_.To_str(val);}
|
||||
public static Byte_obj_ref zero_() {return new_(Byte_.Zero);}
|
||||
public static Byte_obj_ref new_(byte val) {
|
||||
Byte_obj_ref rv = new Byte_obj_ref();
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.core.primitives; import gplx.*; import gplx.core.*;
|
||||
public class Byte_obj_val {
|
||||
public byte Val() {return val;} private byte val;
|
||||
@Override public String toString() {return Int_.Xto_str(val);}
|
||||
@Override public String toString() {return Int_.To_str(val);}
|
||||
@Override public int hashCode() {return val;}
|
||||
@Override public boolean equals(Object obj) {return obj == null ? false : val == ((Byte_obj_val)obj).Val();}
|
||||
public static Byte_obj_val new_(byte val) {
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.core.primitives; import gplx.*; import gplx.core.*;
|
||||
public class Double_obj_val implements CompareAble {
|
||||
public double Val() {return val;} double val;
|
||||
@Override public String toString() {return Double_.Xto_str(val);}
|
||||
@Override public String toString() {return Double_.To_str(val);}
|
||||
@Override public int hashCode() {return (int)val;}
|
||||
@Override public boolean equals(Object obj) {return obj == null ? false : val == ((Double_obj_val)obj).Val();}
|
||||
public int compareTo(Object obj) {Double_obj_val comp = (Double_obj_val)obj; return Double_.Compare(val, comp.val);}
|
||||
|
||||
@@ -23,8 +23,8 @@ public class Int_obj_ref {
|
||||
public int Val_add(int v) {val += v; return val;}
|
||||
public Int_obj_ref Val_zero_() {val = 0; return this;}
|
||||
public Int_obj_ref Val_neg1_() {val = -1; return this;}
|
||||
public String Val_as_str() {return Int_.Xto_str(val);}
|
||||
@Override public String toString() {return Int_.Xto_str(val);}
|
||||
public String Val_as_str() {return Int_.To_str(val);}
|
||||
@Override public String toString() {return Int_.To_str(val);}
|
||||
@Override public int hashCode() {return val;}
|
||||
@Override public boolean equals(Object obj) {return val == ((Int_obj_ref)obj).Val();}
|
||||
public static Int_obj_ref neg1_() {return new_(-1);}
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.core.primitives; import gplx.*; import gplx.core.*;
|
||||
public class Int_obj_val implements CompareAble {
|
||||
public int Val() {return val;} int val;
|
||||
@Override public String toString() {return Int_.Xto_str(val);}
|
||||
@Override public String toString() {return Int_.To_str(val);}
|
||||
@Override public int hashCode() {return val;}
|
||||
@Override public boolean equals(Object obj) {return obj == null ? false : val == ((Int_obj_val)obj).Val();}
|
||||
public int compareTo(Object obj) {Int_obj_val comp = (Int_obj_val)obj; return Int_.Compare(val, comp.val);}
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface String_bldr {
|
||||
String_bldr Add_str_w_crlf(String v);
|
||||
String_bldr Add_spr_unless_first(String s, String spr, int i);
|
||||
String_bldr Clear();
|
||||
String Xto_str_and_clear();
|
||||
String To_str_and_clear();
|
||||
String To_str();
|
||||
int Count();
|
||||
String_bldr Add(byte[] v);
|
||||
@@ -70,7 +70,7 @@ abstract class String_bldr_base implements String_bldr {
|
||||
return this;
|
||||
}
|
||||
public String_bldr Clear() {Del(0, Count()); return this;}
|
||||
public String Xto_str_and_clear() {
|
||||
public String To_str_and_clear() {
|
||||
String rv = To_str();
|
||||
Clear();
|
||||
return rv;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Thread_adp implements Runnable {
|
||||
// public void Stop() {thread.stop();}
|
||||
public boolean IsAlive() {return thread.isAlive();}
|
||||
@Override public void run() {
|
||||
invk.Invk(GfsCtx._, 0, cmd, msg);
|
||||
invk.Invk(GfsCtx.Instance, 0, cmd, msg);
|
||||
}
|
||||
public static final Thread_adp Null = new Thread_adp(Thread_adp_.Name_null, GfoInvkAble_.Null, "", GfoMsg_.Null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user