ObservableInteger.java
上传用户:njled888
上传日期:2007-01-07
资源大小:29k
文件大小:1k
- /*
- * @(#)ObservableInteger.java Version 1.0 98/03/12
- *
- * Copyright (c) 1998 by Huahai Yang
- *
- * Use at your own risk. I do not guarantee the fitness of this
- * software for any purpose, and I do not accept responsibility for
- * any damage you do to yourself or others by using this software.
- * This file may be distributed freely, provided its contents
- * are not tampered with in any way.
- *
- */
- import java.util.*;
- public class ObservableInteger extends Observable
- {
- protected int value;
-
- public ObservableInteger(int value)
- {
- this.value = value;
- } // 1 param constructor
-
- public void set(int newValue)
- {
- if(newValue != value)
- {
- value = newValue;
- setChanged();
- notifyObservers(new Integer(value));
- } //if
- } //setvalue
-
- } //ObservableInteger