1 11 package org.eclipse.core.internal.registry; 12 13 import org.eclipse.core.runtime.InvalidRegistryObjectException; 14 15 21 public abstract class Handle { 22 protected IObjectManager objectManager; 23 24 private int objectId; 25 26 protected int getId() { 27 return objectId; 28 } 29 30 Handle(IObjectManager objectManager, int value) { 31 objectId = value; 32 this.objectManager = objectManager; 33 } 34 35 39 abstract RegistryObject getObject(); 40 41 public boolean equals(Object object) { 42 if (object instanceof Handle) { 43 return objectId == ((Handle) object).objectId; 44 } 45 return false; 46 } 47 48 public int hashCode() { 49 return objectId; 50 } 51 } 52 | Popular Tags |