KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jac > aspects > queue > FieldChangeEvent


1 /*
2   Copyright (C) 2003 Laurent Martelli <laurent@aopsys.com>
3   
4   This program is free software; you can redistribute it and/or modify
5   it under the terms of the GNU Lesser General Public License as
6   published by the Free Software Foundation; either version 2 of the
7   License, or (at your option) any later version.
8
9   This program is distributed in the hope that it will be useful, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   Lesser General Public License for more details.
13
14   You should have received a copy of the GNU Lesser General Public
15   License along with this program; if not, write to the Free Software
16   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17   USA */

18
19 package org.objectweb.jac.aspects.queue;
20
21 import org.objectweb.jac.core.rtti.FieldItem;
22
23 public class FieldChangeEvent {
24    Object JavaDoc substance;
25    FieldItem field;
26    Object JavaDoc oldValue;
27    Object JavaDoc newValue;
28
29    public FieldChangeEvent(Object JavaDoc substance, FieldItem field,
30                            Object JavaDoc oldValue, Object JavaDoc newValue) {
31       this.substance = substance;
32       this.field = field;
33       this.oldValue = oldValue;
34       this.newValue = newValue;
35    }
36    /**
37     * Gets the object whose field was modified.
38     */

39    public Object JavaDoc getSubstance() {
40       return substance;
41    }
42    
43    /**
44     * Gets the modified field item.
45     */

46    public FieldItem getField() {
47       return field;
48    }
49
50    /**
51     * Gets the value of the field before the modification.
52     */

53    public Object JavaDoc getOldValue() {
54       return oldValue;
55    }
56
57    /**
58     * Gets the value of the field after the modification.
59     */

60    public Object JavaDoc getNewValue() {
61       return newValue;
62    }
63
64    public String JavaDoc toString() {
65       return substance+"."+field.getName()+" changed from "+
66          oldValue+" to "+newValue;
67    }
68 }
69
Popular Tags