inria.meije.rc.sugarcubes
Interface Identifier

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
StringID

public interface Identifier
extends java.io.Serializable

This interface defines Identifier of events. Identifiers allow one to reference events in the system. Identifiers can be any type of object implementing that interface. At that time, the standard way to implement identifiers in SugarCubes is to use java strings. That way, one gives a name to an event, and that name can be used to reference the event in a program. But identifiers could be implemented as numbers, or any other kind of objects.

However, only one class of Identifier can be used at the same time in a reactive machine, to create Identifiers that are compatible with the ones used internally in a reactive machine use the appropriate method of the Machine or the ReactiveEngine. You can also use the method of the InternalIdentifiers object used by the target reactive machine if you have a reference to it. This last method is not recommended.

See Also:
Machine.cubeDestructionIdentifier(java.lang.String), Machine.identifierFromString(java.lang.String), ReactiveEngine.cubeDestructionIdentifier(java.lang.String), ReactiveEngine.identifierFromString(java.lang.String), InternalIdentifiers

Method Summary
 boolean equals(java.lang.Object o)
          This method returns true if the object o is an identifier referencing the same event as the identifier on which the equals method is called refers.

Note: This method is defined in a standard Java Object.
 int hashCode()
          This method needs to be implemented in order to use Identifiers as key of a Hashtable.

Note: This method is defined in a standard Java Object.
 java.lang.String toString()
          This method gives a String representation of an event.
 

Method Detail

equals

public boolean equals(java.lang.Object o)
This method returns true if the object o is an identifier referencing the same event as the identifier on which the equals method is called refers.

Note: This method is defined in a standard Java Object. Refer to the documentation in the JDK for more informations.
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
This method needs to be implemented in order to use Identifiers as key of a Hashtable.

Note: This method is defined in a standard Java Object. Refer to the documentation in the JDK for more informations.
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
This method gives a String representation of an event. This method is here for compatibility with Reactive Scripts, but can be also useful for debugging.

Note: This method is defined in a standard Java Object. Refer to the documentation in the JDK for more informations.
Overrides:
toString in class java.lang.Object