Ejemplo n.º 1
0
 public void remove(Track track) {
   synchronized (this) {
     docElt.removeChild(track.getElement());
     tracks.remove(track);
     hash.remove(track.getKey());
   }
 }
Ejemplo n.º 2
0
 public Track add(Track track) {
   synchronized (this) {
     Track copy;
     if ((copy = getTrack(track)) == null) {
       copy = new Track((Element) doc.importNode(track.getElement(), false));
       docElt.appendChild(copy.getElement());
       tracks.add(copy);
       hash.put(copy.getKey(), copy);
     }
     return copy;
   }
 }
Ejemplo n.º 3
0
 public void load(InputStream is) throws IOException, ParserConfigurationException, SAXException {
   doc = db.parse(is);
   docElt = doc.getDocumentElement();
   if (docElt.getTagName().equals(docElementName)) {
     NodeList nl = docElt.getElementsByTagName(trackElementName);
     for (int i = 0; i < nl.getLength(); i++) {
       Element elt = (Element) nl.item(i);
       Track track = new Track(elt);
       tracks.add(track);
       hash.put(track.getKey(), track);
     }
   }
 }
Ejemplo n.º 4
0
 public Track getTrack(Track track) {
   return getTrack(track.getKey());
 }