]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphPropertyVariable.java
Implement equals/hashCode for PropertyInfo
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / StandardGraphPropertyVariable.java
index 7927614cd37f9779292ee4ace98e5fd4ba7f00f0..b7eaf075edea1c1e051981662954629f70673cf1 100644 (file)
@@ -35,12 +35,13 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class StandardGraphPropertyVariable extends AbstractPropertyVariable {
+
     private static final Logger LOGGER = LoggerFactory.getLogger(StandardGraphPropertyVariable.class);
-    
-       protected static final PropertyInfo NO_PROPERTY = new PropertyInfo(null, null,
-                       false, false, Collections.<String> emptySet(), null, null, null, null, null, null,
-                       Collections.<String, Pair<Resource, ChildReference>> emptyMap(),
-                       null, false);
+
+    protected static final PropertyInfo NO_PROPERTY = new PropertyInfo(null, null, true,
+            false, false, Collections.<String> emptySet(), null, null, null, null, null, null,
+            Collections.<String, Pair<Resource, ChildReference>> emptyMap(),
+            null, false);
 
        final public Variable parent;
        final public Resource parentResource;
@@ -170,13 +171,10 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable {
                if(represents == null)
                        throw new InvalidVariableException("Variable is not represented by any resource (URI=" + getPossibleURI(graph) + ").");
                return represents;
-//             return graph.getSingleObject(parentResource, property.predicate);
        }
 
        @Override
        public Resource getPossibleRepresents(ReadGraph graph) throws DatabaseException {
-//        if(parentResource == null) return null;
-//             return graph.getPossibleObject(parentResource, property.predicate);
                return represents;
        }
 
@@ -226,16 +224,6 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable {
 
        @Override
        public Datatype getDatatype(ReadGraph graph) throws DatabaseException {
-//<<<<<<< .mine
-//             
-//     Binding binding = getPossibleDefaultBinding(graph);
-//        if(binding != null) return binding.type();
-//
-//             Variant vt = getVariantValue(graph);
-//             binding = vt.getBinding();
-//             if(binding == null) throw new DatabaseException("No binding in Variant with value " + vt.getValue());
-//             return binding.type();
-//=======
                Datatype type;
                try {                   
                        type = getValueAccessor(graph).getDatatype(graph, this);
@@ -252,7 +240,6 @@ public class StandardGraphPropertyVariable extends AbstractPropertyVariable {
                }
                
                return type;
-//>>>>>>> .r30794
                
        }