/** Updates the state of children by adding given Infos. * @param infos list of Info objects to add * @param entries the final state of entries that should occur */ private void updateAdd (Collection infos, Collection entries) { LinkedList nodes = new LinkedList (); Iterator it = infos.iterator (); while (it.hasNext ()) { Info info = (Info)it.next (); nodes.addAll (info.nodes ()); map.put (info.entry, info); // debug.append ("updateadd: " + info.entry + " info: " + info + '\n'); // NOI18N // printStackTrace(); } this.entries = entries; // debug.append ("Set4: " + entries); // NOI18N // printStackTrace(); clearNodes (); notifyAdd (nodes); }
/** Updates the state of children by adding given Infos. * @param infos list of Info objects to add * @param entries the final state of entries that should occur */ private void updateAdd (Collection infos, Collection entries) { LinkedList nodes = new LinkedList (); Iterator it = infos.iterator (); while (it.hasNext ()) { Info info = (Info)it.next (); nodes.addAll (info.nodes ()); map.put (info.entry, info); // debug.append ("updateadd: " + info.entry + " info: " + info + '\n'); // NOI18N // printStackTrace(); } this.entries = entries; // debug.append ("Set4: " + entries); // NOI18N // printStackTrace(); clearNodes (); notifyAdd (nodes); }
/** Removes the objects from the children. */ private void updateRemove (Node[] current, Set toRemove) { LinkedList nodes = new LinkedList (); Iterator it = toRemove.iterator (); while (it.hasNext ()) { Entry en = (Entry)it.next (); Info info = (Info)map.remove (en); //debug.append ("Removed: " + en + " info: " + info); // NOI18N //debug.append ('\n'); //printStackTrace(); nodes.addAll (info.nodes ()); // Has a NullPointerException been thrown? // In such case consider a key implementation. // The key hashCode() and equals() methods // must behave as for an IMMUTABLE object and // the hashCode() must return the same value // for equals() keys. Ccc } // modify the current set of entries and empty the list of nodes // so it has to be recreated again //debug.append ("Current : " + this.entries + '\n'); // NOI18N this.entries.removeAll (toRemove); //debug.append ("Removing: " + toRemove + '\n'); // NOI18N //debug.append ("New : " + this.entries + '\n'); // NOI18N //printStackTrace(); clearNodes (); notifyRemove (nodes, current); }
/** Removes the objects from the children. */ private void updateRemove (Node[] current, Set toRemove) { LinkedList nodes = new LinkedList (); Iterator it = toRemove.iterator (); while (it.hasNext ()) { Entry en = (Entry)it.next (); Info info = (Info)map.remove (en); //debug.append ("Removed: " + en + " info: " + info); // NOI18N //debug.append ('\n'); //printStackTrace(); nodes.addAll (info.nodes ()); // Has a NullPointerException been thrown? // In such case consider a key implementation. // The key hashCode() and equals() methods // must behave as for an IMMUTABLE object and // the hashCode() must return the same value // for equals() keys. Ccc } // modify the current set of entries and empty the list of nodes // so it has to be recreated again //debug.append ("Current : " + this.entries + '\n'); // NOI18N this.entries.removeAll (toRemove); //debug.append ("Removing: " + toRemove + '\n'); // NOI18N //debug.append ("New : " + this.entries + '\n'); // NOI18N //printStackTrace(); clearNodes (); notifyRemove (nodes, current); }
if (perm != null) { clearNodes ();
if (perm != null) { clearNodes ();
clearNodes (); clearNodes (); notifyAdd (toAdd);
clearNodes (); clearNodes (); notifyAdd (toAdd);