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