]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/NewStatementImpl.java
Removed contact application support prints
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / NewStatementImpl.java
index b4ff7c34de1219b23db25381fe3d7c8816adc53e..518be61d42e73a2467f1a2835e507b61088dbaf5 100644 (file)
@@ -1,82 +1,82 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in 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
-package fi.vtt.simantics.procore.internal;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.Statement;\r
-import org.simantics.db.impl.ResourceImpl;\r
-\r
-public class NewStatementImpl implements Statement {\r
-\r
-    public final ResourceImpl subject;\r
-    public final ResourceImpl predicate;\r
-    public final ResourceImpl object;\r
-    \r
-    public NewStatementImpl(int id, ResourceImpl subject, ResourceImpl predicate, ResourceImpl object) {\r
-        if (null == subject)\r
-            throw new IllegalArgumentException();\r
-        if(null == predicate)\r
-            throw new IllegalArgumentException();\r
-        if(null == predicate)\r
-            throw new IllegalArgumentException();\r
-        this.subject = (ResourceImpl)subject;\r
-        this.predicate = (ResourceImpl)predicate;\r
-        this.object = (ResourceImpl)object;\r
-    }\r
-    @Override\r
-    final public Resource getObject() {\r
-        return object;\r
-    }\r
-\r
-    @Override\r
-    final public Resource getPredicate() {\r
-        return predicate;\r
-    }\r
-\r
-    @Override\r
-    final public Resource getSubject() {\r
-        return subject;\r
-    }\r
-\r
-    public int hashCode()\r
-    {\r
-       // TODO: :)\r
-        int result = 6151 * ((int)(subject.id ^ (subject.id>>>32))*6151 + \r
-        (int)(predicate.id ^ (predicate.id>>>32))) +\r
-        (int)(object.id ^ (object.id>>>32)); \r
-        return result;\r
-        \r
-    }\r
-\r
-    @Override\r
-    public boolean isAsserted(Resource testSubject) {\r
-       return !subject.equals(testSubject);\r
-    }\r
-    \r
-    public boolean equals(Object object)\r
-    {\r
-        if (this == object)\r
-            return true;\r
-        else if (object == null)\r
-            return false;\r
-        try {\r
-            Statement r = (Statement)object;\r
-            return subject.id == r.getSubject().getResourceId() &&\r
-            predicate.id == r.getPredicate().getResourceId() &&\r
-            this.object.id == r.getObject().getResourceId();\r
-        } catch (ClassCastException e) {\r
-            return false;\r
-        }\r
-    }\r
-    \r
-    \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 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 fi.vtt.simantics.procore.internal;
+
+import org.simantics.db.Resource;
+import org.simantics.db.Statement;
+import org.simantics.db.impl.ResourceImpl;
+
+public class NewStatementImpl implements Statement {
+
+    public final ResourceImpl subject;
+    public final ResourceImpl predicate;
+    public final ResourceImpl object;
+    
+    public NewStatementImpl(int id, ResourceImpl subject, ResourceImpl predicate, ResourceImpl object) {
+        if (null == subject)
+            throw new IllegalArgumentException();
+        if(null == predicate)
+            throw new IllegalArgumentException();
+        if(null == object)
+            throw new IllegalArgumentException();
+        this.subject = (ResourceImpl)subject;
+        this.predicate = (ResourceImpl)predicate;
+        this.object = (ResourceImpl)object;
+    }
+    @Override
+    final public Resource getObject() {
+        return object;
+    }
+
+    @Override
+    final public Resource getPredicate() {
+        return predicate;
+    }
+
+    @Override
+    final public Resource getSubject() {
+        return subject;
+    }
+
+    public int hashCode()
+    {
+       // TODO: :)
+        int result = 6151 * ((int)(subject.id ^ (subject.id>>>32))*6151 + 
+        (int)(predicate.id ^ (predicate.id>>>32))) +
+        (int)(object.id ^ (object.id>>>32)); 
+        return result;
+        
+    }
+
+    @Override
+    public boolean isAsserted(Resource testSubject) {
+       return !subject.equals(testSubject);
+    }
+    
+    public boolean equals(Object object)
+    {
+        if (this == object)
+            return true;
+        else if (object == null)
+            return false;
+        try {
+            Statement r = (Statement)object;
+            return subject.id == r.getSubject().getResourceId() &&
+            predicate.id == r.getPredicate().getResourceId() &&
+            this.object.id == r.getObject().getResourceId();
+        } catch (ClassCastException e) {
+            return false;
+        }
+    }
+    
+    
+}