jade.proto.states

Class HandlerSelector

    • Field Detail

      • SELECTION_OK

        public static final int SELECTION_OK
        Value returned by onEnd method if an handler was found mapped to the key
        See Also:
        Constant Field Values
      • SELECTION_NOK

        public static final int SELECTION_NOK
        Value returned by onEnd method if no handler was found mapped to the key
        See Also:
        Constant Field Values
    • Constructor Detail

      • HandlerSelector

        public HandlerSelector(Agent a,
                       DataStore s,
                       java.lang.Object accessKey)
        Constructor for this HandlerSelector.
        Parameters:
        a - is a reference to the Agent object
        s - is the DataStore where the object can be retrieved from
        accessKey - is the key to get the proper object from the DataStore, this is the object that will be later passed as argument to the method getSelectionKey
        See Also:
        getSelectionKey(Object)
    • Method Detail

      • getSelectionKey

        protected abstract java.lang.Object getSelectionKey(java.lang.Object selectionVar)
        Subclasses must provide a concrete implementation for this method. It must return the key to which the handler was bound.
        Parameters:
        selectionVar - the object retrieved from the datastore at the accessKey passed in the constructor
        Returns:
        the key to which the handler was bound
      • registerHandler

        public void registerHandler(java.lang.Object key,
                           Behaviour h)
        Register the bounding between an handler and a key.
        Parameters:
        key - this is the key that must be later returned by the method getSelectionKey when the passed Behaviour must be selected
        h - the handler for this key

These are the official JADE API. For these API backward compatibility is guaranteed accross JADE versions