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

Personal_wikis: Add working implementation of wiki import

This commit is contained in:
gnosygnu
2017-02-16 13:14:18 -05:00
parent 00ab87b1b5
commit 632fad62ae
12 changed files with 240 additions and 20 deletions

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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);}
@@ -26,9 +26,10 @@ public class Db_cfg_hash {
return rv == null ? Db_cfg_itm.Empty : rv;
}
public void Set(String key, String val) {hash.Del(key); Add(key, val);}
public void Add(Db_cfg_itm itm) {hash.Add(itm.Key(), itm);}
public void Add(String key, String val) {
if (hash.Has(key)) throw Err_.new_wo_type("itm exists", "grp", grp, "key", key);
Db_cfg_itm itm = new Db_cfg_itm(grp, key, val);
hash.Add(key, itm);
Add(itm);
}
}