]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/impl/ListenerEntry.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / accessor / impl / ListenerEntry.java
index f21cdf10c29ce8ce34c7fa0555b444eb105a62e9..755d67f9512214175de1f173f97ef6e862b1ca32 100644 (file)
@@ -1,24 +1,24 @@
-/*******************************************************************************\r
- *  Copyright (c) 2010 Association for Decentralized Information Management in\r
- *  Industry THTH ry.\r
- *  All rights reserved. This program and the accompanying materials\r
- *  are made available under the terms of the Eclipse Public License v1.0\r
- *  which accompanies this distribution, and is available at\r
- *  http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- *  Contributors:\r
- *      VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
+/*******************************************************************************
+ *  Copyright (c) 2010 Association for Decentralized Information Management in
+ *  Industry THTH ry.
+ *  All rights reserved. This program and the accompanying materials
+ *  are made available under the terms of the Eclipse Public License v1.0
+ *  which accompanies this distribution, and is available at
+ *  http://www.eclipse.org/legal/epl-v10.html
+ *
+ *  Contributors:
+ *      VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
 package org.simantics.databoard.accessor.impl;
 
-import java.util.Collection;\r
-import java.util.Collections;\r
-import java.util.concurrent.Executor;\r
-\r
-import org.simantics.databoard.accessor.Accessor.Listener;\r
-import org.simantics.databoard.accessor.event.Event;\r
-import org.simantics.databoard.accessor.interestset.InterestSet;\r
-import org.simantics.databoard.accessor.reference.ChildReference;\r
+import java.util.Collection;
+import java.util.Collections;
+import java.util.concurrent.Executor;
+
+import org.simantics.databoard.accessor.Accessor.Listener;
+import org.simantics.databoard.accessor.event.Event;
+import org.simantics.databoard.accessor.interestset.InterestSet;
+import org.simantics.databoard.accessor.reference.ChildReference;
 
 /**
  * ListenerEntry is a linked list of <Listener, InterestSet> pairs
@@ -30,7 +30,7 @@ public class ListenerEntry {
        public Listener listener;
        public InterestSet interestSet;
        // Path from the listened object 
-       public ChildReference path;\r
+       public ChildReference path;
        public Executor executor;
        public ListenerEntry next;
        
@@ -39,7 +39,7 @@ public class ListenerEntry {
                this.listener = listener;
                this.interestSet = interestSet;
                this.path = path;
-               this.executor = executor;\r
+               this.executor = executor;
        }
        
        /**
@@ -93,30 +93,30 @@ public class ListenerEntry {
         * @param e
         */
        public void emitEvent(final Event e) {
-//             e.reference = ChildReference.concatenate(path, e.reference);\r
+//             e.reference = ChildReference.concatenate(path, e.reference);
+               if (executor == null) {
+                       listener.onEvents( Collections.singleton(e) );
+               } else {
+                       executor.execute( new Runnable() {
+                               public void run() {
+                                       listener.onEvents( Collections.singleton(e) );
+                               }});
+               }
+       }
+
+       public void emitEvents(final Collection<Event> events) {
+//             for (Event e : events) {
+//                     e.reference = ChildReference.concatenate(path, e.reference);
+//             }
                if (executor == null) {
-                       listener.onEvents( Collections.singleton(e) );\r
-               } else {\r
-                       executor.execute( new Runnable() {\r
-                               public void run() {\r
-                                       listener.onEvents( Collections.singleton(e) );\r
-                               }});\r
+                       listener.onEvents( events );
+               } else {
+                       executor.execute( new Runnable() {
+                               public void run() {
+                                       listener.onEvents( events );
+                               }});
                }
        }
-\r
-       public void emitEvents(final Collection<Event> events) {\r
-//             for (Event e : events) {\r
-//                     e.reference = ChildReference.concatenate(path, e.reference);\r
-//             }\r
-               if (executor == null) {\r
-                       listener.onEvents( events );\r
-               } else {\r
-                       executor.execute( new Runnable() {\r
-                               public void run() {\r
-                                       listener.onEvents( events );\r
-                               }});\r
-               }\r
-       }\r
        
 }