1 package org.simantics.graph.store;
\r
3 import org.simantics.graph.query.Res;
\r
6 * A resource that exists only in one graph fragment. The resource
\r
7 * is represented as a integer identifier.
\r
8 * @author Hannu Niemistö
\r
10 public class IdRes implements Res {
\r
11 public final GraphStore fragment;
\r
12 public final int id;
\r
14 public IdRes(GraphStore fragment, int id) {
\r
15 this.fragment = fragment;
\r
20 public int hashCode() {
\r
21 return id * 31 + fragment.hashCode();
\r
25 public boolean equals(Object obj) {
\r
28 if (obj == null || getClass() != obj.getClass())
\r
30 IdRes other = (IdRes) obj;
\r
31 return fragment == other.fragment && id == other.id;
\r
35 public String toString() {
\r