// Should only have one per Concepts because of add logs concept PersistentLister implements ILister { new HashMap lists; new HashMap treeMaps; new HashMap hashMaps; new HashMap treeSets; new HashMap vars; transient bool nonSaving; public L getList(S name) { ret getList(name, ll()); } public synchronized L getList(S name, L defaultList) { L l = lists.get(name); if (l == null) { lists.put(name, l = listInConcept(this, cloneList(defaultList))); change(); } ret l; } public synchronized IVar getVar(S name, O defaultValue) { IVar v = vars.get(name); if (v == null) { vars.put(name, v = varInConcept(this, new Var)); change(); } if (!v.has() && defaultValue != null) v.set(defaultValue); ret v; } public synchronized Map getTreeMap(S name) { Map m = treeMaps.get(name); if (m == null) { treeMaps.put(name, m = mapInConcept(this, new TreeMap)); change(); } if (getOpt_raw(m, 'm) == null) fail("map not sane: " + className(m) + " " + struct(m)); ret m; } public synchronized Map getHashMap(S name) { Map m = hashMaps.get(name); if (m == null) { hashMaps.put(name, m = mapInConcept(this, new HashMap)); change(); } applyPersistentMapLogFile(_concepts.programID, name, m, !nonSaving); if (getOpt_raw(m, 'm) == null) fail("map not sane: " + className(m) + " " + struct(m)); ret m; } public synchronized Set getTreeSet(S name) { Set m = treeSets.get(name); if (m == null) { treeSets.put(name, m = setInConcept(this, new TreeSet)); change(); } ret m; } }