/** Writes external. * @param oo * @throws IOException */ public void writeExternal(ObjectOutput oo) throws IOException { // list of names Iterator it = keySet().iterator(); while (it.hasNext()) { String file = (String) it.next(); Map attr = (Map) get(file); if ((attr != null) && !attr.isEmpty()) { oo.writeObject(file); Iterator entries = attr.entrySet().iterator(); while (entries.hasNext()) { Map.Entry entry = (Map.Entry) entries.next(); String key = (String) entry.getKey(); Object value = entry.getValue(); if ((key != null) && (value != null)) { oo.writeObject(key); oo.writeObject(value); } } oo.writeObject(null); } } oo.writeObject(null); }
/** Enum of attributes for one file. */ public Enumeration<String> attrs(String fileName) { Map m = (Map) get(fileName); if (m == null) { return Enumerations.empty(); } else { HashSet s = new HashSet(m.keySet()); return Collections.enumeration(s); } }
/** Writes itself to XML * @param pw is PrintWriter */ public void writeToXML(PrintWriter pw) /*throws IOException */ { // list of names Iterator it = new TreeSet(keySet()).iterator(); XMLMapAttr.writeHeading(pw); while (it.hasNext()) { String file = (String) it.next(); XMLMapAttr attr = (XMLMapAttr) get(file); if ((attr != null) && !attr.isEmpty()) { attr.write(pw, file, " "); // NOI18N } } XMLMapAttr.writeEnding(pw); }
XMLMapAttr m = (XMLMapAttr)get (fileName); if (m != null) { Object o = null;
XMLMapAttr m = (XMLMapAttr)get (fileName); if (m != null) { Object o = null;
/** Writes external. * @param oo * @throws IOException */ public void writeExternal (ObjectOutput oo) throws IOException { // list of names Iterator it = keySet ().iterator (); while (it.hasNext ()) { String file = (String)it.next (); Map attr = (Map)get (file); if (attr != null && !attr.isEmpty ()) { oo.writeObject (file); Iterator entries = attr.entrySet ().iterator (); while (entries.hasNext ()) { Map.Entry entry = (Map.Entry)entries.next (); String key = (String)entry.getKey (); Object value = entry.getValue (); if (key != null && value != null) { oo.writeObject (key); oo.writeObject (value); } } oo.writeObject (null); } } oo.writeObject (null); }
/** Writes external. * @param oo * @throws IOException */ public void writeExternal (ObjectOutput oo) throws IOException { // list of names Iterator it = keySet ().iterator (); while (it.hasNext ()) { String file = (String)it.next (); Map attr = (Map)get (file); if (attr != null && !attr.isEmpty ()) { oo.writeObject (file); Iterator entries = attr.entrySet ().iterator (); while (entries.hasNext ()) { Map.Entry entry = (Map.Entry)entries.next (); String key = (String)entry.getKey (); Object value = entry.getValue (); if (key != null && value != null) { oo.writeObject (key); oo.writeObject (value); } } oo.writeObject (null); } } oo.writeObject (null); }
/** * 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++; }
/** Writes itself to XML * @param pw is PrintWriter */ public void writeToXML (PrintWriter pw) /*throws IOException */{ // list of names Iterator it = new TreeSet(keySet()).iterator(); XMLMapAttr.writeHeading(pw); while (it.hasNext ()) { String file = (String)it.next (); XMLMapAttr attr = (XMLMapAttr)get (file); if (attr != null && !attr.isEmpty ()) { attr.write(pw, file, " ");// NOI18N } } XMLMapAttr.writeEnding(pw); }
/** Writes itself to XML * @param pw is PrintWriter */ public void writeToXML (PrintWriter pw) /*throws IOException */{ // list of names Iterator it = new TreeSet(keySet()).iterator(); XMLMapAttr.writeHeading(pw); while (it.hasNext ()) { String file = (String)it.next (); XMLMapAttr attr = (XMLMapAttr)get (file); if (attr != null && !attr.isEmpty ()) { attr.write(pw, file, " ");// NOI18N } } XMLMapAttr.writeEnding(pw); }
/** Enum of attributes for one file. */ public Enumeration attrs (String fileName) { Map m = (Map)get (fileName); if (m == null) { return org.openide.util.Enumerations.empty(); } else { HashSet s = new HashSet (m.keySet ()); return Collections.enumeration (s); } }
/** Enum of attributes for one file. */ public Enumeration attrs (String fileName) { Map m = (Map)get (fileName); if (m == null) { return org.openide.util.Enumerations.empty(); } else { HashSet s = new HashSet (m.keySet ()); return Collections.enumeration (s); } }
XMLMapAttr m = (XMLMapAttr) get(fileName);
/** * 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++; }