io.sarl.lang.core
Class AgentTrait
All Known Subclasses:
Behavior, Skill, Context
abstract class AgentTrait
extends AgentProtectedAPIObject
This class represents a part of trait of an agent.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Property Summary
Modifier and type Property and description
java.util.UUID iD
Replies the identifier of the agent that has this trait.
Agent owner
Replies the agent that has this trait.
Constructor Summary
Constructor and description
new
Construct a trait.
new(Agent)
Construct a trait to the given agent.
Action Summary
Modifier and type Action and description
protected S clearSkill(Class<T>)
java.util.UUID getID
Replies the identifier of the agent that has this trait.
Agent getOwner
Replies the agent that has this trait.
protected final S getSkill(Class<T>)
protected boolean hasSkill(Class<T>)
boolean isFromMe(Event)
boolean isMe(Address)
boolean isMe(UUID)
protected void operator_mappedTo(Class<T>,S)
protected final S setSkill(S,Class<T>*)
protected final void setSkillIfAbsent(Skill,Class<T>*)
protected void toString(ToStringBuilder)
Inherited: toString
Property Details
iD
val iD : java.util.UUID
Replies the identifier of the agent that has this trait.

This property is an alias for the action: getID

Returns:
the UUID of the owner.
Since:
0.6
owner
var owner : Agent
Replies the agent that has this trait.

This property is an alias for the action: getOwner

Returns:
the owner.
Constructor Details
new
protected new
Construct a trait.
new(Agent)
protected new(Agent)
Construct a trait to the given agent.
Parameters:
agent - the owner of this trait.
Action Details
clearSkill(Class<T>)
protected def clearSkill(Class<T>) : S

with S extends Capacity

getID
def getID : java.util.UUID
Replies the identifier of the agent that has this trait.
Returns:
the UUID of the owner.
Since:
0.6
getOwner
def getOwner : Agent
Replies the agent that has this trait.
Returns:
the owner.
getSkill(Class<T>)
protected def getSkill(Class<T>) : S

with S extends Capacity

hasSkill(Class<T>)
protected def hasSkill(Class<T>) : boolean
isFromMe(Event)
def isFromMe(Event) : boolean
isMe(Address)
def isMe(Address) : boolean
isMe(UUID)
def isMe(UUID) : boolean
operator_mappedTo(Class<T>,S)
protected def operator_mappedTo(Class<T>,S)

with S extends Skill

setSkill(S,Class<T>*)
protected def setSkill(S,Class<T>*) : S

with S extends Skill

setSkillIfAbsent(Skill,Class<T>*)
protected def setSkillIfAbsent(Skill,Class<T>*)
toString(ToStringBuilder)
protected def toString(ToStringBuilder)