01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14: * License for the specific language governing permissions and limitations under
15: * the License.
16: */
17:
18: package java.beans;
19:
20: /**
21: * A type of {@link PropertyChangeEvent} that indicates that an indexed property
22: * has changed.
23: *
24: * @since 1.5
25: */
26: public class IndexedPropertyChangeEvent extends PropertyChangeEvent {
27:
28: private static final long serialVersionUID = -320227448495806870L;
29:
30: private final int index;
31:
32: /**
33: * Creates a new property changed event with an indication of the property
34: * index.
35: *
36: * @param source
37: * the changed bean.
38: * @param propertyName
39: * the changed property, or <code>null</code> to indicate an
40: * unspecified set of the properties have changed.
41: * @param oldValue
42: * the previous value of the property, or <code>null</code> if
43: * the <code>propertyName</code> is <code>null</code> or the
44: * previous value is unknown.
45: * @param newValue
46: * the new value of the property, or <code>null</code> if the
47: * <code>propertyName</code> is <code>null</code> or the new
48: * value is unknown..
49: * @param index
50: * the index of the property.
51: */
52: public IndexedPropertyChangeEvent(Object source,
53: String propertyName, Object oldValue, Object newValue,
54: int index) {
55: super (source, propertyName, oldValue, newValue);
56: this .index = index;
57: }
58:
59: /**
60: * Answer the index of the property that was changed in this event.
61: *
62: * @return The property element index.
63: */
64: public int getIndex() {
65: return index;
66: }
67: }
|