Example #1
0
 public Macro get(int id, boolean create) {
   Map m = db.getMap(NAME);
   Macro c = (Macro) m.get(new Integer(id));
   if (c == null && create) {
     c = create(id);
   }
   return c;
 }
Example #2
0
 public Macro get(String name) {
   Map m = db.getMap(NAME);
   Macro c;
   for (Iterator i = m.values().iterator(); i.hasNext(); ) {
     c = (Macro) i.next();
     if (c.getName().equals(name)) {
       return c;
     }
   }
   return null;
 }
Example #3
0
 public void remove(Macro macro) {
   Map m = db.getMap(NAME);
   m.remove(new Integer(macro.getId()));
 }
Example #4
0
 public void update(Macro macro) {
   Map m = db.getMap(NAME);
   m.put(new Integer(macro.getId()), macro);
 }
Example #5
0
 public Collection getAll() {
   Map m = db.getMap(NAME);
   return m.values();
 }