cz.cuni.amis.pogamut.sposh.elements
Class DriveElement

Package class diagram package DriveElement
java.lang.Object
  extended by cz.cuni.amis.pogamut.sposh.elements.PoshElement<THIS,PARENT>
      extended by cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement<DriveElement,DriveCollection>
          extended by cz.cuni.amis.pogamut.sposh.elements.DriveElement
All Implemented Interfaces:
INamedElement

public final class DriveElement
extends PoshDummyElement<DriveElement,DriveCollection>
implements INamedElement

Drive element (very informative, I know). What is drive? Basically it is a top node of decision tree. It has a trigger and an action. When trigger is satisfied, the drive is elegible to be traversed. Action is just a name, it can be reference (=having same name) to some action, but it can also be reference to C or AP.

In posh it has following syntax(minus variables): (<name> [<trigger>] <name>) The first name is name of the element and second name is name of the action.

In the past, it used to have this form, but not anymore (none knew how to use it and no need to waste scarce resources to support unused features.) (<name> [<trigger>] <name> [<freq>] [<comment>]) The drive is elegible for execution if it has satisfied trigger and it was called less frequently that specified by its frequency (getFreq()).

Author:
HonzaH
See Also:
Useful to have an idea what is {@link DriveElement} for.

Field Summary
static DataFlavor dataFlavor
          Data flavor of drive, used in drag-and-drop
static String deName
          Property name for name of a drive
 
Fields inherited from class cz.cuni.amis.pogamut.sposh.elements.PoshDummyElement
IDENT_PATTERN
 
Method Summary
 TriggeredAction getAction()
          Get action of this drive (will be performed if elegible, has satisfied trigger and highest priority).
 List<PoshElement> getChildDataNodes()
          Get list of children of this node.
 String getComment()
          Deprecated. Not supported in editor
 DataFlavor getDataFlavor()
          Get data flavour of posh plan element,used during DnD from palette to PoshScene.
 Freq getFreq()
          Deprecated. Part of original posh, not supported in editor.
 String getName()
          Get name of the element.
 Trigger<DriveElement> getTrigger()
          Get trigger of this drive.
 LapType getType()
          Get type of the element.
 boolean moveChild(int newIndex, PoshElement child)
          Move child to the @newIndex.
 void setDriveName(String newName)
          Set name of the drive to new name.
 String toString()
           
 
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

deName

public static final String deName
Property name for name of a drive

See Also:
Constant Field Values

dataFlavor

public static final DataFlavor dataFlavor
Data flavor of drive, used in drag-and-drop

Method Detail

getTrigger

public Trigger<DriveElement> getTrigger()
Get trigger of this drive.


getAction

public TriggeredAction getAction()
Get action of this drive (will be performed if elegible, has satisfied trigger and highest priority).

Returns:
action of this drive

toString

public String toString()
Overrides:
toString in class Object

getChildDataNodes

public List<PoshElement> getChildDataNodes()
Description copied from class: PoshElement
Get list of children of this node. Most likely auto generated every time this method is called.

Specified by:
getChildDataNodes in class PoshElement<DriveElement,DriveCollection>
Returns:
List of all children of this node.

getName

public String getName()
Description copied from interface: INamedElement
Get name of the element. The actual name, not display name (e.g. action can have FQN of class, but display name would be derived fromk annotations of the class) or representation (e.g. sense name "health" is different from actual condition of sense "health > 90").

Specified by:
getName in interface INamedElement
Returns:
Name of the element

setDriveName

public void setDriveName(String newName)
                  throws InvalidNameException,
                         DuplicateNameException
Set name of the drive to new name.

Parameters:
newName - New name of the drive.
Throws:
InvalidNameException - If name doesn't match PoshDummyElement.IDENT_PATTERN regexp.
DuplicateNameException

moveChild

public boolean moveChild(int newIndex,
                         PoshElement child)
Description copied from class: PoshElement
Move child to the @newIndex. After child was moved (if it was moved), notify listeners.

Specified by:
moveChild in class PoshElement<DriveElement,DriveCollection>
Returns:
if node succesfully moved

getDataFlavor

public DataFlavor getDataFlavor()
Description copied from class: PoshElement
Get data flavour of posh plan element,used during DnD from palette to PoshScene.

Specified by:
getDataFlavor in class PoshElement<DriveElement,DriveCollection>
Returns:
dataFlavour of posh plan element, never null.

getType

public LapType getType()
Description copied from class: PoshElement
Get type of the element.

Specified by:
getType in class PoshElement<DriveElement,DriveCollection>
Returns:
Type of element.

getFreq

@Deprecated
public Freq getFreq()
Deprecated. Part of original posh, not supported in editor.

Get how frequent can this drive be executed. Basically PoshEngine in each evaluation selects the drive with highest priority that has satisfied trigger and is being called less frequently, than specified by the frequency of the drive element.

Returns:
maximal frequency with which this drive can be called.

getComment

@Deprecated
public String getComment()
Deprecated. Not supported in editor

Get comment of this drive.

Returns:
comment of the drive


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.