-/*******************************************************************************\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.ArrayList;\r
-import java.util.Collection;\r
-import java.util.LinkedList;\r
-import java.util.List;\r
-\r
-import org.simantics.databoard.accessor.Accessor;\r
-import org.simantics.databoard.accessor.event.Event;\r
-import org.simantics.databoard.accessor.event.ModificationEvent;\r
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.simantics.databoard.accessor.Accessor;
+import org.simantics.databoard.accessor.event.Event;
+import org.simantics.databoard.accessor.event.ModificationEvent;
/**
* ChangeSet is a collection of a modification events. ChangeSet can be applied
public List<Event> events = new LinkedList<Event>();
- public synchronized void addEvent(Event event) {\r
- if (event instanceof ModificationEvent == false) return; \r
- this.events.add(event);\r
- }\r
-\r
- public synchronized void addEvents(Collection<Event> events) {\r
- for (Event e : events) {\r
- if (e instanceof ModificationEvent == false) return; \r
- this.events.addAll(events);\r
- }\r
- }\r
+ public synchronized void addEvent(Event event) {
+ if (event instanceof ModificationEvent == false) return;
+ this.events.add(event);
+ }
+
+ public synchronized void addEvents(Collection<Event> events) {
+ for (Event e : events) {
+ if (e instanceof ModificationEvent == false) return;
+ this.events.addAll(events);
+ }
+ }
/**
* Returns events and clears change set.