1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
Files
gnosygnu_xowa/140_dbs/src/gplx/stores/DbMaprMgr.java

49 lines
2.1 KiB
Java
Raw Normal View History

2014-06-30 00:04:32 -04:00
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
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.stores; import gplx.*;
public class DbMaprMgr {
public DbMaprArg[] RootIndexFlds() {return rootIndexFlds;} public DbMaprMgr RootIndexFlds_(DbMaprArg... val) {rootIndexFlds = val; return this;} DbMaprArg[] rootIndexFlds;
public DbMaprItm Root() {return root;} public DbMaprMgr Root_(DbMaprItm v) {root = v; return this;} DbMaprItm root;
2015-05-24 22:43:55 -04:00
public List_adp OwnerStack() {return ownerStack;} List_adp ownerStack = List_adp_.new_();
public Ordered_hash ContextVars() {return contextVars;} Ordered_hash contextVars = Ordered_hash_.new_();
public List_adp MaprStack() {return maprStack;} List_adp maprStack = List_adp_.new_();
2014-06-30 00:04:32 -04:00
public void EnvStack_add(DbMaprItm mapr, SrlObj gobj) {
for (Object argObj : mapr.ContextFlds()) {
DbMaprArg arg = (DbMaprArg)argObj;
Object contextVal = GfoInvkAble_.InvkCmd((GfoInvkAble)gobj, arg.ObjProp());
2015-05-24 22:43:55 -04:00
this.ContextVars().Add_if_dupe_use_nth(arg.DbFld(), contextVal);
2014-06-30 00:04:32 -04:00
}
this.OwnerStack().Add(gobj);
this.MaprStack().Add(mapr);
}
public void EnvStack_del(DbMaprItm mapr, SrlObj gobj) {
for (Object argObj : mapr.ContextFlds()) {
DbMaprArg arg = (DbMaprArg)argObj;
this.ContextVars().Del(arg.DbFld());
}
2015-05-24 22:43:55 -04:00
List_adp_.DelAt_last(this.OwnerStack());
List_adp_.DelAt_last(this.MaprStack());
2014-06-30 00:04:32 -04:00
}
public void Clear() {
ownerStack.Clear();
contextVars.Clear();
maprStack.Clear();
}
public static DbMaprMgr new_() {return new DbMaprMgr();} DbMaprMgr() {}
}