public final class Competence extends PoshDummyElement<Competence,PoshPlan> implements IParametrizedElement
choices.
If you imagine a decision tree, the point, where node splits into several
subnodes is akin to the to the Competence.
What is difference between Competence and DriveCollection?
Well, for one, DC is in the root of the plan, DC has a goal (well, Cs had
goal too in the past), the main difference how they are processed by the
engine (see description of how DriveCollection is evaluated).
Unlike DC, Competence is simple decision tree, engine will take the element
with highest priority and satisfied trigger and traverses into that node
without looking back.DriveCollection| Modifier and Type | Field and Description |
|---|---|
static String |
cnName
Property string of competence name
|
static String |
cnParams
Property string of competence parameters
|
static DataFlavor |
dataFlavor
Data flavor of competence classs, used for drag-and-drop
|
IDENT_PATTERN| Modifier and Type | Method and Description |
|---|---|
void |
addElement(CompetenceElement choice)
Add passed element as the last element of this competence and emit.
|
void |
addElement(int index,
CompetenceElement choice)
Add choice as the @index element of all competences choices + emit.
|
DataFlavor |
getDataFlavor()
Get data flavour of posh plan element,used during DnD from palette to
PoshScene.
|
String |
getHtmlDescription()
Get HTML description of the competence.
|
List<CompetenceElement> |
getChildDataNodes()
Get list of children of this node.
|
CompetenceElement |
getChoice(int choiceId)
Get choice with specified id.
|
int |
getChoiceId(CompetenceElement choice)
Get index of @choice.
|
List<CompetenceElement> |
getChoices() |
String |
getName()
Get name of the competence
|
FormalParameters |
getParameters()
Get list of formal parametrs of competence (names and default values).
|
LapType |
getType()
Get type of the element.
|
boolean |
moveChild(int newIndex,
PoshElement child)
Move child to the @newIndex.
|
void |
removeElement(CompetenceElement element)
Remove the
CompetenceElement from this competence and emit
notification about deletion. |
void |
rename(String newCompetenceName)
Rename
Competence in the PoshPlan. |
void |
setName(String name)
Change name of competence node.
|
void |
setParameters(FormalParameters newParams)
Set new parameters.
|
String |
toString()
Create text representation of this competence, compatible with parser, so
we can directly output it.
|
getElementId, getUnusedName, isUsedName, moveChildInListaddElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getElementListeners, getChildId, getChildren, getId, getParent, getRootNode, isChildOfParent, removeElementListener, setParentpublic static final String cnName
public static final String cnParams
public static final DataFlavor dataFlavor
public void addElement(CompetenceElement choice) throws DuplicateNameException
choice - element that will be added into this competenceDuplicateNameExceptionpublic void addElement(int index,
CompetenceElement choice)
throws DuplicateNameException
index - Index at which should the choice be addedchoice - Choice to add. Orphan.DuplicateNameExceptionpublic String toString()
public List<CompetenceElement> getChildDataNodes()
PoshElementgetChildDataNodes in class PoshElement<Competence,PoshPlan>public List<CompetenceElement> getChoices()
public CompetenceElement getChoice(int choiceId)
getChoices().List.get(int).choiceId - Id of desired choicepublic void setName(String name) throws DuplicateNameException, CycleException, InvalidNameException
name - new name of competence nodeDuplicateNameExceptionCycleExceptionInvalidNameExceptionpublic String getName()
getName in interface INamedElementpublic String getHtmlDescription()
public boolean moveChild(int newIndex,
PoshElement child)
PoshElementmoveChild in class PoshElement<Competence,PoshPlan>public DataFlavor getDataFlavor()
PoshElementgetDataFlavor in class PoshElement<Competence,PoshPlan>public LapType getType()
PoshElementgetType in class PoshElement<Competence,PoshPlan>public void removeElement(CompetenceElement element)
CompetenceElement from this competence and emit
notification about deletion.element - Element to be removed.public FormalParameters getParameters()
getParameters in interface IParametrizedElementpublic void setParameters(FormalParameters newParams)
IParametrizedElementsetParameters in interface IParametrizedElementnewParams - new parameterspublic void rename(String newCompetenceName) throws InvalidNameException, CycleException, DuplicateNameException
Competence in the PoshPlan. This method changes
name fo the comeptence, finds all
references to the competence (the ones with old
name) and changed them to @newCompetenceName.rename in interface INamedElementnewCompetenceName - New name of comeptence after renamingInvalidNameException - Passed name is not valid Yaposh name.CycleException - Renaming causes cycle.DuplicateNameException - Such name is already used in the plan.public int getChoiceId(CompetenceElement choice)
choice - Choice for which we are looking for an index.IllegalArgumentException - If choice is not among choices of this
competence.Copyright © 2018 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.