}
protected final Resource relation;
- protected final Resource component;
protected final Resource literal;
- public CompileValueRequest(Resource component, Resource literal, Resource relation) {
+ public CompileValueRequest(Resource literal, Resource relation) {
this.relation = relation;
- this.component = component;
this.literal = literal;
}
public CompileValueRequest(ReadGraph graph, Variable context) throws DatabaseException {
- this(context.getParent(graph).getRepresents(graph),
- context.getRepresents(graph),
- context.getPredicateResource(graph));
+ this(context.getRepresents(graph), context.getPredicateResource(graph));
}
public static Object compileAndEvaluate(ReadGraph graph, Variable context) throws DatabaseException {
}
}
- public static Function1<Object,Object> compile(ReadGraph graph, Resource component, Resource literal, Resource predicate) throws DatabaseException {
+ public static Function1<Object,Object> compile(ReadGraph graph, Resource literal, Resource predicate) throws DatabaseException {
SCLContext sclContext = SCLContext.getCurrent();
Object oldGraph = sclContext.get("graph");
try {
- Function1<Object,Object> exp = graph.syncRequest(new CompileValueRequest(component, literal, predicate),
- TransientCacheListener.instance());
+ Function1<Object,Object> exp = graph.syncRequest(new CompileValueRequest(literal, predicate), TransientCacheListener.instance());
sclContext.put("graph", graph);
return exp;
} catch (DatabaseException e) {
return null;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((literal == null) ? 0 : literal.hashCode());
+ result = prime * result + ((relation == null) ? 0 : relation.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CompileValueRequest other = (CompileValueRequest) obj;
+ if (literal == null) {
+ if (other.literal != null)
+ return false;
+ } else if (!literal.equals(other.literal))
+ return false;
+ if (relation == null) {
+ if (other.relation != null)
+ return false;
+ } else if (!relation.equals(other.relation))
+ return false;
+ return true;
+ }
+
+
}