public final class CompetenceElement extends PoshDummyElement<CompetenceElement,Competence> implements INamedElement, IConditionElement<CompetenceElement>
Competence. It
has a name(not used elsewhere in the tree, but unique), Trigger and
defined TriggeredAction that should be evaluated if the triggers is
satisfied.
Example in POSH:
(move (trigger ((see-player))) move-player)
| Modifier and Type | Field and Description |
|---|---|
static String |
ceComment
Property name of
comment. |
static String |
ceName
Property name of
name. |
static String |
ceRetries
Property name of
retries. |
static DataFlavor |
dataFlavor
Data flavor of competence element, used for drag and drop.
|
static int |
INFINITE_RETRIES
Special value for infinite number of retries.
|
IDENT_PATTERN| Constructor and Description |
|---|
CompetenceElement(String name,
List<Sense> triggerSenses,
PrimitiveCall actionCall,
int retries,
String comment)
Create a choice.
|
| Modifier and Type | Method and Description |
|---|---|
TriggeredAction |
getAction()
Get action of this choice.
|
String |
getComment()
Deprecated.
Not supported in the editor.
|
Trigger<CompetenceElement> |
getCondition()
Get trigger of the choice.
|
DataFlavor |
getDataFlavor()
Get data flavour of posh plan element,used during DnD from palette to
PoshScene.
|
List<PoshElement> |
getChildDataNodes()
Get list of children of this node.
|
String |
getName()
Get name of the element.
|
int |
getRetries()
Deprecated.
Remnants of original posh,
|
Trigger<CompetenceElement> |
getTrigger()
Get trigger of this choice.
|
LapType |
getType()
Get type of the element.
|
boolean |
moveChild(int newIndex,
PoshElement child)
Move child to the @newIndex.
|
void |
rename(String newName)
Becasue name of a choice is not used as reference in the plan, this
method only changes a name of a choice, identical to
setName(java.lang.String). |
void |
setComment(String newComment)
Deprecated.
Not used in the editor
|
void |
setName(String name)
Set name of this choice.
|
void |
setRetries(int newRetries)
Deprecated.
Not used in the editor
|
String |
toString() |
getElementId, getUnusedName, isUsedName, moveChildInListaddElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getElementListeners, getChildId, getChildren, getId, getParent, getRootNode, isChildOfParent, removeElementListener, setParentpublic static final String ceName
name.public static final String ceRetries
retries.public static final String ceComment
comment.public static final DataFlavor dataFlavor
public static final int INFINITE_RETRIES
getRetries(),
Constant Field Valuespublic CompetenceElement(String name, List<Sense> triggerSenses, PrimitiveCall actionCall, int retries, String comment)
name - Name of a choicetriggerSenses - List of senses that will trigger the action of this
choiceactionCall - Action call(=action name with arguments), name can be a
normal action, an AP/C name.public Trigger<CompetenceElement> getTrigger()
public Trigger<CompetenceElement> getCondition()
getCondition in interface IConditionElement<CompetenceElement>public TriggeredAction getAction()
public List<PoshElement> getChildDataNodes()
PoshElementgetChildDataNodes in class PoshElement<CompetenceElement,Competence>public String getName()
INamedElementgetName in interface INamedElementpublic void setName(String name) throws InvalidNameException, DuplicateNameException
name - new name of this choice.InvalidNameExceptionDuplicateNameExceptionpublic void rename(String newName) throws InvalidNameException, CycleException, DuplicateNameException
setName(java.lang.String).rename in interface INamedElementnewName - New name of choice.InvalidNameException - Passed name is not valid Yaposh name.CycleException - Renaming causes cycle.DuplicateNameException - Such name is already used in the plan.setName(java.lang.String)public boolean moveChild(int newIndex,
PoshElement child)
PoshElementmoveChild in class PoshElement<CompetenceElement,Competence>public DataFlavor getDataFlavor()
PoshElementgetDataFlavor in class PoshElement<CompetenceElement,Competence>public LapType getType()
PoshElementgetType in class PoshElement<CompetenceElement,Competence>@Deprecated public int getRetries()
@Deprecated public void setRetries(int newRetries)
newRetries - new number of retries. Must be ≥0 or INFINITE_RETRIES.@Deprecated public String getComment()
@Deprecated public void setComment(String newComment)
newComment - New comment of this elementCopyright © 2018 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.