title: Adding an item to an indexed property - PropertyChangeSupport
body: <p>I am currently working with PropertyChangeListeners and I want to know if it would be advisable to fire a property change whenever an object is added (or removed, for that matter) to an indexed property such as an ArrayList. </p>
  
  <pre><code>public class SimpleBean implements Serializable
  {
     private ArrayList&lt;Matrix&gt; mats;
     private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
  
     public SimpleBean()
     {...}
  
     public void addMat(Matrix m)
     {
        pcs.firePropertyChange("mats", null, m); // I'm having trouble with the parameters
        mats.add(m);
     }
  
  }
  </code></pre>
  
  <p>I was reading the PropertyChangeListener tutorials and it seemed like it was appropriate to fire a property change whenever the value of a bound property changed. Well, I wasn't quite sure if this meant that I should fire a property change whenever a property was modified by <em>any</em> means or only when the property (or an element of that property) was strictly set/reassigned to a different value. </p>
  
  <p>In my program, it would be very convenient if several classes could change every time an element is removed from or added to the mats ArrayList, and I figured that a PropertyChangeListener could help me in that regard.</p>
  
  <p>Please let me know if this method is not recommended and if there is another way that other classes can listen and respond to deletion/addition to indexed properties.</p>