]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.common/src/org/simantics/db/common/request/ResourceAsyncRead3.java
Automatically import also SCLMain modules of dependent index roots
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / request / ResourceAsyncRead3.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.common.request;
13
14 import org.simantics.db.Resource;
15 import org.simantics.db.request.AsyncRead;
16
17 public abstract class ResourceAsyncRead3<T> implements AsyncRead<T> {
18
19     final protected Resource resource;
20     final protected Resource resource2;
21     final protected Resource resource3;
22
23     @Override
24     final public int hashCode() {
25         return resource.hashCode() + 41 * (resource2.hashCode() + 31 * resource3.hashCode());
26     }
27
28     @Override
29     public int threadHash() {
30         return resource.hashCode() >>> 16;
31     }
32     
33     @Override
34     final public boolean equals(Object object) {
35         if (this == object)
36             return true;
37         else if (object == null)
38             return false;
39         else if (getClass() != object.getClass())
40             return false;
41         ResourceAsyncRead3<?> r = (ResourceAsyncRead3<?>) object;
42         return resource.equals(r.resource) && resource2.equals(r.resource2) && resource3.equals(r.resource3);
43     }
44
45     @Override
46     public int getFlags() {
47         return 0;
48     }
49     
50     public ResourceAsyncRead3(Resource resource, Resource resource2, Resource resource3) {
51         this.resource = resource;
52         this.resource2 = resource2;
53         this.resource3 = resource3;
54     }
55
56 }