]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/SingleObjectProcedure.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / graph / SingleObjectProcedure.java
index 2080165d106ff6656ebac44feb67daffe3e267b1..06823b09f5c95795a22e8549d368c80274bc41ca 100644 (file)
@@ -1,45 +1,45 @@
-package org.simantics.db.impl.graph;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.NoSingleResultException;\r
-import org.simantics.db.impl.query.IntProcedure;\r
-import org.simantics.db.impl.query.QueryProcessor;\r
-\r
-public class SingleObjectProcedure implements IntProcedure {\r
-\r
-       final private QueryProcessor processor;\r
-       private DatabaseException exception;\r
-       private Resource result;\r
-       \r
-       public SingleObjectProcedure(QueryProcessor processor) {\r
-               this.processor = processor;\r
-       }\r
-       \r
-       @Override\r
-       public void execute(ReadGraphImpl graph, int i) {\r
-               Resource resource = processor.querySupport.getResource(i);\r
-               if(result != null) {\r
-                       exception = new NoSingleResultException("");\r
-               } else {\r
-                       result = resource;\r
-               }\r
-       }\r
-\r
-       @Override\r
-       public void finished(ReadGraphImpl graph) {\r
-               if(result == null) exception = new NoSingleResultException("");\r
-       }\r
-\r
-       @Override\r
-       public void exception(ReadGraphImpl graph, Throwable throwable) {\r
-               if(throwable instanceof DatabaseException) exception = (DatabaseException)throwable;\r
-               else throwable = new DatabaseException(throwable);\r
-       }\r
-       \r
-       public Resource get() throws DatabaseException {\r
-               if(exception != null) throw exception;\r
-               else return result;\r
-       }\r
-\r
-}\r
+package org.simantics.db.impl.graph;
+
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.exception.NoSingleResultException;
+import org.simantics.db.impl.query.IntProcedure;
+import org.simantics.db.impl.query.QueryProcessor;
+
+public class SingleObjectProcedure implements IntProcedure {
+
+       final private QueryProcessor processor;
+       private DatabaseException exception;
+       private Resource result;
+       
+       public SingleObjectProcedure(QueryProcessor processor) {
+               this.processor = processor;
+       }
+       
+       @Override
+       public void execute(ReadGraphImpl graph, int i) {
+               Resource resource = processor.querySupport.getResource(i);
+               if(result != null) {
+                       exception = new NoSingleResultException("");
+               } else {
+                       result = resource;
+               }
+       }
+
+       @Override
+       public void finished(ReadGraphImpl graph) {
+               if(result == null) exception = new NoSingleResultException("");
+       }
+
+       @Override
+       public void exception(ReadGraphImpl graph, Throwable throwable) {
+               if(throwable instanceof DatabaseException) exception = (DatabaseException)throwable;
+               else throwable = new DatabaseException(throwable);
+       }
+       
+       public Resource get() throws DatabaseException {
+               if(exception != null) throw exception;
+               else return result;
+       }
+
+}