/** Add a property to this set, replacing any old one with the same name. * @param p the property to add * @return the property with the same name that was replaced, or <code>null</code> for a fresh insertion */ public synchronized Node.Property<?> put(Node.Property<?> p) { int indx = findIndex(p.getName()); Node.Property<?> removed; if (indx != -1) { // replaces the original one removed = props.set(indx, p); } else { // adds this to the end props.add(p); removed = null; } // clears computed array and fires into about change of properties refresh(); return removed; }
/** Add several properties to this set, replacing old ones with the same names. * * @param ar properties to add */ public synchronized void put(Node.Property<?>[] ar) { for (int i = 0; i < ar.length; i++) { Node.Property<?> p = ar[i]; p = ar[i]; int indx = findIndex(p.getName()); if (indx != -1) { // replaces the original one props.set(indx, p); } else { // adds this to the end props.add(p); } } // clears computed array and fires into about change of properties refresh(); }
/** Remove a property from the set. * @param name name of the property to remove * @return the removed property, or <code>null</code> if it was not there to begin with */ public synchronized Node.Property<?> remove(String name) { int indx = findIndex(name); if (indx != -1) { try { return props.remove(indx); } finally { // clears computed array and fires into about change of properties refresh(); } } else { return null; } }
/** Add several properties to this set, replacing old ones with the same names. * * @param ar properties to add */ public synchronized void put (Node.Property[] ar) { for (int i = 0; i < ar.length; i++) { Node.Property p = ar[i]; p = ar[i]; int indx = findIndex (p.getName ()); if (indx != -1) { // replaces the original one props.set (indx, p); } else { // adds this to the end props.add (p); } } // clears computed array and fires into about change of properties refresh (); }
/** Add several properties to this set, replacing old ones with the same names. * * @param ar properties to add */ public synchronized void put (Node.Property[] ar) { for (int i = 0; i < ar.length; i++) { Node.Property p = ar[i]; p = ar[i]; int indx = findIndex (p.getName ()); if (indx != -1) { // replaces the original one props.set (indx, p); } else { // adds this to the end props.add (p); } } // clears computed array and fires into about change of properties refresh (); }
/** Add a property to this set, replacing any old one with the same name. * @param p the property to add * @return the property with the same name that was replaced, or <code>null</code> for a fresh insertion */ public synchronized Node.Property put (Node.Property p) { int indx = findIndex (p.getName ()); Node.Property removed; if (indx != -1) { // replaces the original one removed = (Node.Property)props.set (indx, p); } else { // adds this to the end props.add (p); removed = null; } // clears computed array and fires into about change of properties refresh (); return removed; }
/** Add a property to this set, replacing any old one with the same name. * @param p the property to add * @return the property with the same name that was replaced, or <code>null</code> for a fresh insertion */ public synchronized Node.Property put (Node.Property p) { int indx = findIndex (p.getName ()); Node.Property removed; if (indx != -1) { // replaces the original one removed = (Node.Property)props.set (indx, p); } else { // adds this to the end props.add (p); removed = null; } // clears computed array and fires into about change of properties refresh (); return removed; }
/** Remove a property from the set. * @param name name of the property to remove * @return the removed property, or <code>null</code> if it was not there to begin with */ public synchronized Node.Property remove (String name) { int indx = findIndex (name); if (indx != -1) { try { return (Node.Property)props.remove (indx); } finally { // clears computed array and fires into about change of properties refresh (); } } else { return null; } }
/** Remove a property from the set. * @param name name of the property to remove * @return the removed property, or <code>null</code> if it was not there to begin with */ public synchronized Node.Property remove (String name) { int indx = findIndex (name); if (indx != -1) { try { return (Node.Property)props.remove (indx); } finally { // clears computed array and fires into about change of properties refresh (); } } else { return null; } }