KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > beans > IndexedPropertyChangeEvent


1 /*
2  * @(#)IndexedPropertyChangeEvent.java 1.4 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package java.beans;
8
9 /**
10  * An "IndexedPropertyChange" event gets delivered whenever a component that
11  * conforms to the JavaBeans<TM> specification (a "bean") changes a bound
12  * indexed property. This class is an extension of <code>PropertyChangeEvent</code>
13  * but contains the index of the property that has changed.
14  * <P>
15  * Null values may be provided for the old and the new values if their
16  * true values are not known.
17  * <P>
18  * An event source may send a null object as the name to indicate that an
19  * arbitrary set of if its properties have changed. In this case the
20  * old and new values should also be null.
21  *
22  * @version 1.4 12/19/03
23  * @since 1.5
24  * @author Mark Davidson
25  */

26 public class IndexedPropertyChangeEvent extends PropertyChangeEvent JavaDoc {
27
28     private int index;
29
30     /**
31      * Constructs a new <code>IndexedPropertyChangeEvent</code> object.
32      *
33      * @param source The bean that fired the event.
34      * @param propertyName The programmatic name of the property that
35      * was changed.
36      * @param oldValue The old value of the property.
37      * @param newValue The new value of the property.
38      * @param index index of the property element that was changed.
39      */

40     public IndexedPropertyChangeEvent(Object JavaDoc source, String JavaDoc propertyName,
41                       Object JavaDoc oldValue, Object JavaDoc newValue,
42                       int index) {
43     super (source, propertyName, oldValue, newValue);
44     this.index = index;
45     }
46
47
48     /**
49      * Gets the index of the property that was changed.
50      *
51      * @return The index specifying the property element that was
52      * changed.
53      */

54     public int getIndex() {
55     return index;
56     }
57 }
58
59
Popular Tags