fr.dyade.aaa.agent

Class RoleMultiple

Implemented Interfaces:
Serializable

public class RoleMultiple
extends java.lang.Object
implements Serializable

This structure provides code for managing target agents registering in a role. A notification may be sent to a role using the sendTo function of the sending agent. The class does not handle duplicates in the list.

Constructor Summary

RoleMultiple()
RoleMultiple(String name)
Creates a new RoleMultiple with a specified name.

Method Summary

void
addListener(AgentId target)
Adds an agent in the listeners list.
boolean
contains(AgentId id)
Tests if the specified agent id belongs to role multiple.
Enumeration
getListeners()
Gets the listeners list as an Enumeration of AgentId objects.
String
getName()
Returns the role name.
void
removeListener(AgentId target)
Removes an agent from the listeners list.
void
setName(String name)
Sets the role name.
String
toString()
Provides a string image for this object.

Constructor Details

RoleMultiple

public RoleMultiple()


RoleMultiple

public RoleMultiple(String name)
Creates a new RoleMultiple with a specified name.

Parameters:
name - the role name.

Method Details

addListener

public void addListener(AgentId target)
Adds an agent in the listeners list.


contains

public boolean contains(AgentId id)
Tests if the specified agent id belongs to role multiple.

Parameters:
id - the specified agent id.

Returns:
true if the specified id belongs to the role; false otherwise.


getListeners

public Enumeration getListeners()
Gets the listeners list as an Enumeration of AgentId objects. There is no synchronization as we assume this object is manipulated from the enclosing agent reaction.


getName

public String getName()
Returns the role name.


removeListener

public void removeListener(AgentId target)
Removes an agent from the listeners list.


setName

public void setName(String name)
Sets the role name.

Parameters:
name - the role name.


toString

public String toString()
Provides a string image for this object.


Copyright B) 2004 Scalagent - All rights reserved