- All Implemented Interfaces:
An object that can exist in one of two states: defined and undefined. This is used by APIs that want to give a handle to an object, even though the object does not fully exist yet. This way, users can attach listeners to objects before they come into existence. It also protects the API from users that do not release references when they should.
To enforce good coding practice, all handle objects must implement
toString. Please use
string to cache the result for
All handle objects are referred to using a single identifier. This identifier
is a instance of
String. It is important that this identifier
remain unique within whatever context that handle object is being used. For
example, there should only ever be one instance of
with a given identifier.
Method SummaryModifier and TypeMethodDescription
booleanTests whether this object is equal to another object.
getId()Returns the identifier for this object.
hashCode()Computes the hash code for this object based on the id.
final booleanWhether this instance is defined.
toString()The string representation of this object -- for debugging purposes only.
undefine()Makes this object becomes undefined.
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
definedprotected transient boolean definedWhether this object is defined. A defined object is one that has been fully initialized. By default, all objects start as undefined.
idprotected final String idThe identifier for this object. This identifier should be unique across all objects of the same type and should never change. This value will never be
stringprotected transient String stringThe string representation of this object. This string is for debugging purposes only, and is not meant to be displayed to the user. This value is computed lazily, and is cleared if one of its dependent values changes.
(String id)Constructs a new instance of
id- The id of this handle; must not be
equalspublic boolean equals
(Object object)Tests whether this object is equal to another object. A handle object is only equal to another handle object with the same id and the same class.
getIdpublic final String getId()Description copied from interface:
IIdentifiableReturns the identifier for this object.
hashCodepublic final int hashCode()Computes the hash code for this object based on the id.
isDefinedpublic final boolean isDefined()Whether this instance is defined. A defined instance is one that has been fully initialized. This allows objects to effectively disappear even though other objects may still have references to them.
trueif this object is defined;
toStringpublic abstract String toString()The string representation of this object -- for debugging purposes only. This string should not be shown to an end user.
undefinepublic abstract void undefine()Makes this object becomes undefined. This method should make any defined properties
null. It should also send notification to any listeners that these properties have changed.