XMLMapAttr getAttr(boolean create) { if (create && (foAttrs == null)) { foAttrs = new XMLMapAttr(); } return foAttrs; }
/** @return true if at lest one attribute changed */ public boolean attacheAttrs(XMLMapAttr attrs) { if ((attrs == null) || attrs.isEmpty()) { return false; } if (foAttrs == null) { foAttrs = new XMLMapAttr(); } Iterator it = attrs.entrySet().iterator(); boolean ch = false; while (it.hasNext()) { Map.Entry attrEntry = (Map.Entry) it.next(); Object prev = foAttrs.put(attrEntry.getKey(), attrEntry.getValue()); ch |= (prev == null && attrEntry.getValue() != null) || !prev.equals(attrEntry.getValue()); } return ch; }
/** * Sets an attribute to the table. * New added - for Sandwich project (XML format instead of serialization) . * @param fileName - name of file * @param attrName - name of attribute * @param obj - attribute */ final void setAttr(String fileName, String attrName, Object obj) { XMLMapAttr m = (XMLMapAttr) get(fileName); if (m == null) { m = new XMLMapAttr(); //HashMap (7);//XMLMapAttr(); put(fileName, m); } m.put(attrName, obj, false); if ((obj == null) && (m.size() == 1)) { remove(fileName); } // increments the version version++; }
XMLMapAttr getAttr ( boolean create ) { if (create && foAttrs == null) foAttrs = new XMLMapAttr (); return foAttrs; }
XMLMapAttr getAttr ( boolean create ) { if (create && foAttrs == null) foAttrs = new XMLMapAttr (); return foAttrs; }
public void attacheAttrs (XMLMapAttr attrs) { if ( attrs == null || attrs.isEmpty()) { return; } if (foAttrs == null) foAttrs = new XMLMapAttr (); Iterator it = attrs.entrySet ().iterator (); while (it.hasNext()) { Map.Entry attrEntry = (Map.Entry )it.next(); foAttrs.put (attrEntry.getKey(), attrEntry.getValue()); } }
public void attacheAttrs (XMLMapAttr attrs) { if ( attrs == null || attrs.isEmpty()) { return; } if (foAttrs == null) foAttrs = new XMLMapAttr (); Iterator it = attrs.entrySet ().iterator (); while (it.hasNext()) { Map.Entry attrEntry = (Map.Entry )it.next(); foAttrs.put (attrEntry.getKey(), attrEntry.getValue()); } }
/** * Sets an attribute to the table. * New added - for Sandwich project (XML format instead of serialization) . * @param fileName - name of file * @param attrName - name of attribute * @param obj - attribute */ final void setAttr (String fileName, String attrName, Object obj) { XMLMapAttr m = (XMLMapAttr)get (fileName); if (m == null) { m = new XMLMapAttr();//HashMap (7);//XMLMapAttr(); put (fileName, m); } m.put (attrName, obj, false); if (obj == null && m.size() == 1) { remove(fileName); } // increments the version version++; }
/** * Sets an attribute to the table. * New added - for Sandwich project (XML format instead of serialization) . * @param fileName - name of file * @param attrName - name of attribute * @param obj - attribute */ final void setAttr (String fileName, String attrName, Object obj) { XMLMapAttr m = (XMLMapAttr)get (fileName); if (m == null) { m = new XMLMapAttr();//HashMap (7);//XMLMapAttr(); put (fileName, m); } m.put (attrName, obj, false); if (obj == null && m.size() == 1) { remove(fileName); } // increments the version version++; }