]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.common/src/org/simantics/db/common/request/ResourceAsyncRead3.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / request / ResourceAsyncRead3.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.common.request;\r
13 \r
14 import org.simantics.db.Resource;\r
15 import org.simantics.db.request.AsyncRead;\r
16 \r
17 public abstract class ResourceAsyncRead3<T> implements AsyncRead<T> {\r
18 \r
19     final protected Resource resource;\r
20     final protected Resource resource2;\r
21     final protected Resource resource3;\r
22 \r
23     @Override\r
24     final public int hashCode() {\r
25         return resource.hashCode() + 41 * (resource2.hashCode() + 31 * resource3.hashCode());\r
26     }\r
27 \r
28     @Override\r
29     public int threadHash() {\r
30         return resource.hashCode() >>> 16;\r
31     }\r
32     \r
33     @Override\r
34     final public boolean equals(Object object) {\r
35         if (this == object)\r
36             return true;\r
37         else if (object == null)\r
38             return false;\r
39         else if (getClass() != object.getClass())\r
40             return false;\r
41         ResourceAsyncRead3<?> r = (ResourceAsyncRead3<?>) object;\r
42         return resource.equals(r.resource) && resource2.equals(r.resource2) && resource3.equals(r.resource3);\r
43     }\r
44 \r
45     @Override\r
46     public int getFlags() {\r
47         return 0;\r
48     }\r
49     \r
50     public ResourceAsyncRead3(Resource resource, Resource resource2, Resource resource3) {\r
51         this.resource = resource;\r
52         this.resource2 = resource2;\r
53         this.resource3 = resource3;\r
54     }\r
55 \r
56 }\r