Package jadex.tools.comanalyzer
Class Component
- java.lang.Object
 - 
- jadex.tools.comanalyzer.ParameterElement
 - 
- jadex.tools.comanalyzer.Component
 
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,java.lang.Comparable
public class Component extends ParameterElement
The Agent object.- See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.util.ListAGENT_ATTRIBUTESThe allowed message attributes.static java.lang.StringAIDstatic java.lang.StringDESCRIPTIONstatic ComponentDUMMY_COMPONENTThe dummy agentstatic java.lang.StringDUMMY_NAMEThe name for the dummy agentstatic java.lang.StringIDThe id of the elementstatic java.lang.StringMESSAGE_COUNTstatic java.lang.StringMESSAGE_VISIBLEprotected java.util.ListmessagesThe messages send or received by the agentstatic intNO_MESSAGESstatic java.lang.StringSTATEstatic java.lang.StringSTATE_DEADstatic java.lang.StringSTATE_DUMMYstatic java.lang.StringSTATE_IGNOREDstatic java.lang.StringSTATE_OBSERVEDstatic java.lang.StringSTATE_REMOTE- 
Fields inherited from class jadex.tools.comanalyzer.ParameterElement
CLASS, NAME, parameters, visible 
 - 
 
- 
Constructor Summary
Constructors Constructor Description Component()Constructor for a dummy agent which represents every agent not present on the canvas.Component(IComponentDescription desc)Constructor for any named agent to be put on the Agent Canvas 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(Message message)Adds a message to the agent.booleanapplyFilter(ComponentFilter[] filter, boolean zeromessages)Applies a filter to the agent and returns if the visibility has changed.intcompareTo(java.lang.Object o)Agents are compared by their names.static java.lang.String[]getDeclaredAttributes()IComponentDescriptiongetDescription()java.lang.StringgetId()java.util.ListgetMessages()Returns the messages send or received by the agent.java.lang.ObjectgetParameter(java.lang.String name)Returns the parameter with the given name.java.util.MapgetParameters()Returns the parameter map.java.lang.StringgetState()voidremoveAllMessages()Removes all messages send or received by the agent.voidremoveMessage(Message message)Removes a message from the agent.voidsetMessages(java.util.List messages)Set the messages.voidsetState(java.lang.String state)java.lang.StringtoString()- 
Methods inherited from class jadex.tools.comanalyzer.ParameterElement
equals, hasParameter, isVisible, setParameter, setParameters, setVisible 
 - 
 
 - 
 
- 
- 
Field Detail
- 
DUMMY_COMPONENT
public static final Component DUMMY_COMPONENT
The dummy agent 
- 
DUMMY_NAME
public static final java.lang.String DUMMY_NAME
The name for the dummy agent- See Also:
 - Constant Field Values
 
 
- 
STATE
public static final java.lang.String STATE
- See Also:
 - Constant Field Values
 
 
- 
ID
public static final java.lang.String ID
The id of the element- See Also:
 - Constant Field Values
 
 
- 
AID
public static final java.lang.String AID
- See Also:
 - Constant Field Values
 
 
- 
DESCRIPTION
public static final java.lang.String DESCRIPTION
- See Also:
 - Constant Field Values
 
 
- 
MESSAGE_COUNT
public static final java.lang.String MESSAGE_COUNT
- See Also:
 - Constant Field Values
 
 
- 
MESSAGE_VISIBLE
public static final java.lang.String MESSAGE_VISIBLE
- See Also:
 - Constant Field Values
 
 
- 
NO_MESSAGES
public static final int NO_MESSAGES
- See Also:
 - Constant Field Values
 
 
- 
STATE_DEAD
public static final java.lang.String STATE_DEAD
- See Also:
 - Constant Field Values
 
 
- 
STATE_OBSERVED
public static final java.lang.String STATE_OBSERVED
- See Also:
 - Constant Field Values
 
 
- 
STATE_IGNORED
public static final java.lang.String STATE_IGNORED
- See Also:
 - Constant Field Values
 
 
- 
STATE_DUMMY
public static final java.lang.String STATE_DUMMY
- See Also:
 - Constant Field Values
 
 
- 
STATE_REMOTE
public static final java.lang.String STATE_REMOTE
- See Also:
 - Constant Field Values
 
 
- 
AGENT_ATTRIBUTES
public static final java.util.List AGENT_ATTRIBUTES
The allowed message attributes. 
- 
messages
protected java.util.List messages
The messages send or received by the agent 
 - 
 
- 
Constructor Detail
- 
Component
public Component()
Constructor for a dummy agent which represents every agent not present on the canvas. 
- 
Component
public Component(IComponentDescription desc)
Constructor for any named agent to be put on the Agent Canvas 
 - 
 
- 
Method Detail
- 
getDeclaredAttributes
public static final java.lang.String[] getDeclaredAttributes()
- Returns:
 - The declared agent attributes.
 
 
- 
getParameters
public java.util.Map getParameters()
Returns the parameter map.- Overrides:
 getParametersin classParameterElement- Returns:
 - The parameter map.
 
 
- 
getParameter
public java.lang.Object getParameter(java.lang.String name)
Returns the parameter with the given name.- Overrides:
 getParameterin classParameterElement- Parameters:
 name- The parameter name.- Returns:
 - The parameter object
 
 
- 
getDescription
public IComponentDescription getDescription()
- Returns:
 - The component description.
 
 
- 
getState
public java.lang.String getState()
- Returns:
 - The state.
 
 
- 
setState
public void setState(java.lang.String state)
- Parameters:
 state- The state to set.
 
- 
applyFilter
public boolean applyFilter(ComponentFilter[] filter, boolean zeromessages)
Applies a filter to the agent and returns if the visibility has changed.- Parameters:
 filter- The array of filters to apply to.zeromessages-Trueif the zero message filter should be applied- Returns:
 - True if visibility has changed.
 
 
- 
getMessages
public java.util.List getMessages()
Returns the messages send or received by the agent.- Returns:
 - The array of messages.
 
 
- 
setMessages
public void setMessages(java.util.List messages)
Set the messages.- Parameters:
 messages- The messages.
 
- 
addMessage
public void addMessage(Message message)
Adds a message to the agent.- Parameters:
 message- The message to add to the agent.
 
- 
removeMessage
public void removeMessage(Message message)
Removes a message from the agent.- Parameters:
 message- The message to remove.
 
- 
removeAllMessages
public void removeAllMessages()
Removes all messages send or received by the agent. 
- 
getId
public java.lang.String getId()
- Specified by:
 getIdin classParameterElement- Returns:
 - The id of the element.
 
 
- 
compareTo
public int compareTo(java.lang.Object o)
Agents are compared by their names. Only the dummy agent is always the first in line.- Specified by:
 compareToin interfacejava.lang.Comparable- Overrides:
 compareToin classParameterElement
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classParameterElement- Returns:
 - The string representation.
 
 
 - 
 
 -