1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db.impl.query;
14 import org.simantics.db.exception.DatabaseException;
15 import org.simantics.db.impl.graph.ReadGraphImpl;
16 import org.simantics.db.request.RequestFlags;
19 abstract public class BinaryQuery<Procedure> extends CacheEntryBase<Procedure> implements Query {
23 public BinaryQuery(final long r1, final long r2) {
35 final public int r1() {
36 return (int)(id>>>32);
39 final public int r2() {
43 final protected static long id(long r1, long r2) {
44 long result = (r1<<32) | (r2 & 0xffffffffL);
50 return RequestFlags.INVALIDATE;
54 final public boolean equals(Object object) {
57 else if (object == null)
59 else if (getClass() != object.getClass())
61 BinaryQuery<?> other = (BinaryQuery<?>)object;
62 return id == other.id;
66 final public Query getQuery() {
71 // public void recompute(ReadGraphImpl graph, Object provider, CacheEntry entry) throws DatabaseException {
72 // recompute(graph, (QueryProcessor)provider);
75 // @SuppressWarnings("unchecked")
77 // public Object performFromCache(ReadGraphImpl graph, Object provider, Object procedure) throws DatabaseException {
78 // return performFromCache(graph, (QueryProcessor)provider, (Procedure)procedure);
81 //abstract public void recompute(ReadGraphImpl graph, QueryProcessor provider) throws DatabaseException ;
82 //abstract public void compute(ReadGraphImpl graph, Procedure procedure) throws DatabaseException ;
83 //abstract public Object performFromCache(ReadGraphImpl graph, QueryProcessor provider, Procedure procedure) throws DatabaseException;
84 //abstract public void putEntry(QueryProcessor provider);
85 abstract public void removeEntry(QueryProcessor provider);