From 40a9d99496e098562f090fb7ffce9e749011b131 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Mon, 20 May 2024 17:58:16 -0400 Subject: Formatting pass --- .../java/net/wotonomy/control/EOObserverProxy.java | 125 +++++++++------------ 1 file changed, 54 insertions(+), 71 deletions(-) (limited to 'projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOObserverProxy.java') diff --git a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOObserverProxy.java b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOObserverProxy.java index e616a33..ce8c9a7 100644 --- a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOObserverProxy.java +++ b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/control/EOObserverProxy.java @@ -21,84 +21,67 @@ package net.wotonomy.control; import net.wotonomy.foundation.NSSelector; /** -* A convenience observer for objects that do not or cannot -* subclass EODelayedObserver. EOObserverProxy will invoke -* an NSSelector on an object when it receives a subjectChanged -* message. -* -* @author michael@mpowers.net -* @author $Author: cgruber $ -* @version $Revision: 893 $ -*/ -public class EOObserverProxy - extends EODelayedObserver -{ - protected Object target; - protected NSSelector selector; - protected int priority; - - /** - * Constructs an EODelayedObserver that will invoke the specified selector - * on the specified object, and will run at the specified priority. - */ - public EOObserverProxy ( - Object anObject, NSSelector aSelector, int aPriority ) - { - target = anObject; - selector = aSelector; - priority = aPriority; - } + * A convenience observer for objects that do not or cannot subclass + * EODelayedObserver. EOObserverProxy will invoke an NSSelector on an object + * when it receives a subjectChanged message. + * + * @author michael@mpowers.net + * @author $Author: cgruber $ + * @version $Revision: 893 $ + */ +public class EOObserverProxy extends EODelayedObserver { + protected Object target; + protected NSSelector selector; + protected int priority; - /** - * Constructs an EODelayedObserver that will invoke the specified selector - * on the specified object, and will run at ObserverPriorityThird priority, - * which is the default. - */ - public EOObserverProxy ( - Object anObject, NSSelector aSelector ) - { - this( anObject, aSelector, ObserverPriorityThird ); - } + /** + * Constructs an EODelayedObserver that will invoke the specified selector on + * the specified object, and will run at the specified priority. + */ + public EOObserverProxy(Object anObject, NSSelector aSelector, int aPriority) { + target = anObject; + selector = aSelector; + priority = aPriority; + } - /** - * Returns the priority of this observer in the queue. - * This implementation returns the priority specified - * in the constructor. - */ - public int priority () - { - return priority; - } + /** + * Constructs an EODelayedObserver that will invoke the specified selector on + * the specified object, and will run at ObserverPriorityThird priority, which + * is the default. + */ + public EOObserverProxy(Object anObject, NSSelector aSelector) { + this(anObject, aSelector, ObserverPriorityThird); + } + + /** + * Returns the priority of this observer in the queue. This implementation + * returns the priority specified in the constructor. + */ + public int priority() { + return priority; + } + + /** + * Notifies observer that one or more objects that it is observing have changed. + * The observer should check all objects it is observing for changes. + */ + public void subjectChanged() { + try { + selector.invoke(target); + } catch (Exception exc) { + System.out.println("Error notifying observer: "); + exc.printStackTrace(); + } + } - /** - * Notifies observer that one or more objects that - * it is observing have changed. The observer should - * check all objects it is observing for changes. - */ - public void subjectChanged () - { - try - { - selector.invoke( target ); - } - catch ( Exception exc ) - { - System.out.println( "Error notifying observer: " ); - exc.printStackTrace(); - } - } - } /* - * $Log$ - * Revision 1.1 2006/02/16 13:19:57 cgruber - * Check in all sources in eclipse-friendly maven-enabled packages. + * $Log$ Revision 1.1 2006/02/16 13:19:57 cgruber Check in all sources in + * eclipse-friendly maven-enabled packages. * - * Revision 1.1 2001/10/22 21:55:32 mpowers - * This turns out to be a really useful class. + * Revision 1.1 2001/10/22 21:55:32 mpowers This turns out to be a really useful + * class. * * */ - - -- cgit v1.2.3