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.List
AGENT_ATTRIBUTES
The allowed message attributes.static java.lang.String
AID
static java.lang.String
DESCRIPTION
static Component
DUMMY_COMPONENT
The dummy agentstatic java.lang.String
DUMMY_NAME
The name for the dummy agentstatic java.lang.String
ID
The id of the elementstatic java.lang.String
MESSAGE_COUNT
static java.lang.String
MESSAGE_VISIBLE
protected java.util.List
messages
The messages send or received by the agentstatic int
NO_MESSAGES
static java.lang.String
STATE
static java.lang.String
STATE_DEAD
static java.lang.String
STATE_DUMMY
static java.lang.String
STATE_IGNORED
static java.lang.String
STATE_OBSERVED
static java.lang.String
STATE_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 void
addMessage(Message message)
Adds a message to the agent.boolean
applyFilter(ComponentFilter[] filter, boolean zeromessages)
Applies a filter to the agent and returns if the visibility has changed.int
compareTo(java.lang.Object o)
Agents are compared by their names.static java.lang.String[]
getDeclaredAttributes()
IComponentDescription
getDescription()
java.lang.String
getId()
java.util.List
getMessages()
Returns the messages send or received by the agent.java.lang.Object
getParameter(java.lang.String name)
Returns the parameter with the given name.java.util.Map
getParameters()
Returns the parameter map.java.lang.String
getState()
void
removeAllMessages()
Removes all messages send or received by the agent.void
removeMessage(Message message)
Removes a message from the agent.void
setMessages(java.util.List messages)
Set the messages.void
setState(java.lang.String state)
java.lang.String
toString()
-
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:
getParameters
in classParameterElement
- Returns:
- The parameter map.
-
getParameter
public java.lang.Object getParameter(java.lang.String name)
Returns the parameter with the given name.- Overrides:
getParameter
in 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
-True
if 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:
getId
in 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:
compareTo
in interfacejava.lang.Comparable
- Overrides:
compareTo
in classParameterElement
-
toString
public java.lang.String toString()
- Overrides:
toString
in classParameterElement
- Returns:
- The string representation.
-
-