1 /*******************************************************************************
2 * Copyright (c) 2007, 2018 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.request.RequestFlags;
16 public abstract class BinaryQuery<Procedure> extends CacheEntryBase<Procedure> implements Query {
20 public BinaryQuery(final long r1, final long r2) {
32 final public int r1() {
33 return (int)(id>>>32);
36 final public int r2() {
40 final protected static long id(long r1, long r2) {
41 long result = (r1<<32) | (r2 & 0xffffffffL);
47 return RequestFlags.INVALIDATE;
51 final public boolean equals(Object object) {
54 else if (object == null)
56 else if (getClass() != object.getClass())
58 BinaryQuery<?> other = (BinaryQuery<?>)object;
59 return id == other.id;
63 final public Query getQuery() {
67 abstract public void removeEntry(QueryProcessor provider);