diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-05-27 11:38:33 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-05-27 11:38:33 -0400 |
| commit | 7c279747beb43c7e88633a6228a155a30e6834f7 (patch) | |
| tree | 511176048944fa7332dc1a163a6148c46e7c61b3 /israfil-foundation-valuemodel/src/main/java/net/israfil/foundation/valuemodel/Observable.java | |
Initial import
Diffstat (limited to 'israfil-foundation-valuemodel/src/main/java/net/israfil/foundation/valuemodel/Observable.java')
| -rw-r--r-- | israfil-foundation-valuemodel/src/main/java/net/israfil/foundation/valuemodel/Observable.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/israfil-foundation-valuemodel/src/main/java/net/israfil/foundation/valuemodel/Observable.java b/israfil-foundation-valuemodel/src/main/java/net/israfil/foundation/valuemodel/Observable.java new file mode 100644 index 0000000..574c8cf --- /dev/null +++ b/israfil-foundation-valuemodel/src/main/java/net/israfil/foundation/valuemodel/Observable.java @@ -0,0 +1,37 @@ +/*
+ * Copyright (c) 2003-2007 Israfil Consulting Services Corporation
+ * Copyright (c) 2003-2007 Christian Edward Gruber
+ * All Rights Reserved
+ *
+ * $Id: Types.java 129 2006-12-31 23:20:02Z cgruber $
+ */
+package net.israfil.foundation.valuemodel;
+
+/**
+ * An interface for objects that can notify observers of changes to itself. The
+ * changing object should call the provided callback signature, with the
+ * parameter being the object that was changed in its new state.
+ *
+ * Using a dynamic selector rather than a strong interface allows code
+ * to be notified of the change even if it was not constructed with the
+ * notification interface, though it does need to match the signature.
+ *
+ * @author <a href="mailto:cgruber@israfil.net">Christian Edward Gruber</a>
+ * @author Latest: $Author: cgruber $
+ * @version $Revision: 129 $
+ */
+public interface Observable {
+
+ /** Add an observer to this object, with a callback method spec that will
+ * be invoked upon a data change. The callback method should contain three
+ * object parameters, one for the sender, one for the old value, and one for
+ * the new value. The meaning of the value (same object, copy, values, etc.)
+ * is left to the implementation object and the observers.
+ */
+ public void addObservers(String callback, Object ... observers);
+ /**
+ * Remove observer from observable object.
+ */
+ public void removeObservers(Object ... observers);
+
+}
|
