|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.sposh.elements.PoshElement<THIS,PARENT>
cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement<Competence,PoshPlan>
cz.cuni.amis.pogamut.sposh.elements.Competence
public final class Competence
Competence is basically a named structure offering several choices.
If you imagine a decision tree, the point, where node splits into several
subnodes is akin to the to the Competence.
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| Field Summary | |
|---|---|
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 |
| Fields inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement |
|---|
IDENT_PATTERN |
| Method Summary | |
|---|---|
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. |
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()
|
DataFlavor |
getDataFlavor()
Get data flavour of posh plan element,used during DnD from palette to PoshScene. |
String |
getHtmlDescription()
Get HTML description of the competence. |
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. |
| Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement |
|---|
getElementId, getUnusedName, isUsedName, moveChildInList |
| Methods inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshElement |
|---|
addElementListener, emitChildDeleted, emitChildMove, emitChildNode, firePropertyChange, getChildId, getChildren, getElementListeners, getId, getParent, getRootNode, isChildOfParent, removeElementListener, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String cnName
public static final String cnParams
public static final DataFlavor dataFlavor
| Method Detail |
|---|
public void addElement(CompetenceElement choice)
throws DuplicateNameException
choice - element that will be added into this competence
DuplicateNameException
public void addElement(int index,
CompetenceElement choice)
throws DuplicateNameException
index - Index at which should the choice be addedchoice - Choice to add. Orphan.
DuplicateNameExceptionpublic String toString()
toString in class Objectpublic List<CompetenceElement> getChildDataNodes()
PoshElement
getChildDataNodes in class PoshElement<Competence,PoshPlan>public List<CompetenceElement> getChoices()
public CompetenceElement getChoice(int choiceId)
getChoices().List.get(int).
choiceId - Id of desired choice
public void setName(String name)
throws DuplicateNameException,
CycleException,
InvalidNameException
name - new name of competence node
DuplicateNameException
CycleException
InvalidNameExceptionpublic String getName()
getName in interface INamedElementpublic String getHtmlDescription()
public boolean moveChild(int newIndex,
PoshElement child)
PoshElement
moveChild in class PoshElement<Competence,PoshPlan>public DataFlavor getDataFlavor()
PoshElement
getDataFlavor in class PoshElement<Competence,PoshPlan>public LapType getType()
PoshElement
getType 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)
IParametrizedElement
setParameters in interface IParametrizedElementnewParams - new parameters
public 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 renaming
InvalidNameException - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||