]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ModelledVariablePropertyDescriptorImpl.java
Sync git svn branch with SVN repository r33158.
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / ModelledVariablePropertyDescriptorImpl.java
1 package org.simantics.db.layer0.variable;\r
2 \r
3 import org.simantics.db.Resource;\r
4 \r
5 public class ModelledVariablePropertyDescriptorImpl implements ModelledVariablePropertyDescriptor {\r
6         final private Variable variable;\r
7         final private Resource subject;\r
8         final private Resource property;\r
9         public ModelledVariablePropertyDescriptorImpl(Variable variable, Resource subject, Resource property) {\r
10                 this.variable = variable;\r
11                 this.subject = subject;\r
12                 this.property = property;\r
13         }\r
14         public Variable getVariable() {\r
15                 return variable;\r
16         }\r
17         public Resource getSubject() {\r
18                 return subject;\r
19         }\r
20         public Resource getProperty() {\r
21                 return property;\r
22         }\r
23         @Override\r
24         public int hashCode() {\r
25                 return subject.hashCode() ^ 31*property.hashCode() ^ 41*variable.hashCode();\r
26         }\r
27         @Override\r
28         public boolean equals(Object obj) {\r
29                 if(this == obj) return true;\r
30                 if(!(obj instanceof ModelledVariablePropertyDescriptorImpl)) return false;\r
31                 ModelledVariablePropertyDescriptorImpl other = (ModelledVariablePropertyDescriptorImpl)obj;\r
32                 if(!subject.equals(other.subject)) return false;\r
33                 if(!property.equals(other.property)) return false;\r
34                 return variable.equals(other.variable);\r
35         }\r
36 }\r