mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.langs.durations; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
|
||||
public class Xol_duration_itm_ {
|
||||
private static final Hash_adp_bry regy = Hash_adp_bry.ci_a7(); // ASCII:MW.consts
|
||||
private static final Hash_adp_bry regy = Hash_adp_bry.ci_a7(); // ASCII:MW.consts
|
||||
public static final byte
|
||||
Tid_millenia = 0
|
||||
, Tid_centuries = 1
|
||||
@@ -29,7 +29,7 @@ public class Xol_duration_itm_ {
|
||||
, Tid_minutes = 7
|
||||
, Tid_seconds = 8
|
||||
;
|
||||
public static final Xol_duration_itm
|
||||
public static final Xol_duration_itm
|
||||
Itm_millenia = new_(Tid_millenia , "millenia" , 31556952000L)
|
||||
, Itm_centuries = new_(Tid_centuries , "centuries" , 3155695200L)
|
||||
, Itm_decades = new_(Tid_decades , "decades" , 315569520L)
|
||||
@@ -45,7 +45,7 @@ public class Xol_duration_itm_ {
|
||||
regy.Add(rv.Name_bry(), rv);
|
||||
return rv;
|
||||
}
|
||||
public static final Xol_duration_itm[] Ary_default = new Xol_duration_itm[]
|
||||
public static final Xol_duration_itm[] Ary_default = new Xol_duration_itm[]
|
||||
{ Itm_millenia
|
||||
, Itm_centuries
|
||||
, Itm_decades
|
||||
@@ -58,7 +58,7 @@ public class Xol_duration_itm_ {
|
||||
};
|
||||
public static Xol_duration_itm[] Xto_itm_ary(Keyval[] kv_ary) {
|
||||
if (kv_ary == null) return Xol_duration_itm_.Ary_default;
|
||||
List_adp rv = List_adp_.new_();
|
||||
List_adp rv = List_adp_.New();
|
||||
int len = kv_ary.length;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Keyval kv = kv_ary[i];
|
||||
@@ -76,5 +76,5 @@ class Xol_duration_itm_sorter implements gplx.core.lists.ComparerAble {
|
||||
Xol_duration_itm rhs = (Xol_duration_itm)rhsObj;
|
||||
return -Long_.Compare(lhs.Seconds(), rhs.Seconds()); // - to sort from largest to smallest
|
||||
}
|
||||
public static final Xol_duration_itm_sorter Instance = new Xol_duration_itm_sorter(); Xol_duration_itm_sorter() {}
|
||||
public static final Xol_duration_itm_sorter Instance = new Xol_duration_itm_sorter(); Xol_duration_itm_sorter() {}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ import gplx.xowa.langs.msgs.*;
|
||||
public class Xol_duration_mgr {
|
||||
private Xol_msg_itm[] interval_msgs = null;
|
||||
public Xol_duration_mgr(Xol_lang_itm lang) {this.lang = lang;} private Xol_lang_itm lang;
|
||||
private Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
|
||||
private Bry_bfr tmp_bfr = Bry_bfr_.Reset(255);
|
||||
public Xol_interval_itm[] Get_duration_intervals(long seconds, Xol_duration_itm[] intervals) {
|
||||
if (intervals == null) intervals = Xol_duration_itm_.Ary_default;
|
||||
Array_.Sort(intervals, Xol_duration_itm_sorter.Instance);
|
||||
int intervals_len = intervals.length;
|
||||
long val = seconds;
|
||||
List_adp rv = List_adp_.new_();
|
||||
List_adp rv = List_adp_.New();
|
||||
for (int i = 0; i < intervals_len; i++) {
|
||||
Xol_duration_itm itm = intervals[i];
|
||||
long itm_seconds = itm.Seconds();
|
||||
@@ -65,7 +65,7 @@ public class Xol_duration_mgr {
|
||||
byte[] msg_key = Bry_.Add(Bry_duration, itm.Name_bry());
|
||||
interval_msgs[i] = msg_mgr.Itm_by_key_or_new(msg_key);
|
||||
}
|
||||
} private static final byte[] Bry_duration = Bry_.new_a7("duration-");
|
||||
} private static final byte[] Bry_duration = Bry_.new_a7("duration-");
|
||||
private void List_to_str_init() {
|
||||
Xol_msg_mgr msg_mgr = lang.Msg_mgr();
|
||||
Msg_and = msg_mgr.Val_by_str_or_empty("and");
|
||||
|
||||
Reference in New Issue
Block a user