Ignore:
Timestamp:
08/14/13 17:04:42 (11 years ago)
Author:
pharms
Message:
  • rework of task model to move event instance stuff to task instances
  • introduction of sequence, selection, iteration and optional instances
Location:
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/IEventTask.java

    r1180 r1294  
    1515package de.ugoe.cs.autoquest.tasktrees.treeifc; 
    1616 
    17 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 
    18 import de.ugoe.cs.autoquest.eventcore.IEventType; 
    19  
    2017/** 
    2118 * <p> 
    2219 * Event tasks represent single events. They have no children and are therefore the leaf nodes of 
    23  * a task model. They provide information about the event they represent. This includes the event 
    24  * type and the target. 
     20 * a task model. They provide information about the event they represent as a String description. 
     21 * They do not refer to events, as they may represented several semantically equal but lexically 
     22 * different events. Their description carries as much information as required to show the 
     23 * level of distinction. 
    2524 * </p> 
    2625 *  
     
    2928public interface IEventTask extends ITask { 
    3029     
    31     /** 
    32      * <p> 
    33      * return the type of the event represented by this task 
    34      * </p> 
    35      *  
    36      * @return as described 
    37      */ 
    38     public IEventType getEventType(); 
    39  
    40     /** 
    41      * <p> 
    42      * return the target of the event represented by this task 
    43      * </p> 
    44      *  
    45      * @return as described 
    46      */ 
    47     public IEventTarget getEventTarget(); 
    48  
    4930    /** 
    5031     * <p> 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/ITask.java

    r1180 r1294  
    1616 
    1717import java.io.Serializable; 
     18import java.util.Collection; 
    1819 
    1920/** 
     
    4950     */ 
    5051    public String getDescription(); 
     52 
     53    /** 
     54     * <p> 
     55     * returns a collection of all observed instances of this task 
     56     * </p> 
     57     *  
     58     * @return as described 
     59     */ 
     60    public Collection<ITaskInstance> getInstances(); 
    5161 
    5262    /** 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/ITaskBuilder.java

    r1197 r1294  
    2626    /** 
    2727     * <p> 
    28      * adds a child to a task instance. May ensure, that the child is a valid child considering 
     28     * adds a child to a sequence instance. May ensure, that the child is a valid child considering 
    2929     * the task model of the parent. In that case, an IllegalArgumentException is thrown. 
    3030     * </p> 
    3131     *  
    32      * @param taskInstance the instance of add the child to 
    33      * @param child        the child to be added 
    34      *  
    35      * @throws IllegalArgumentException as described 
    36      */ 
    37     void addChild(ITaskInstance taskInstance, ITaskInstance child) throws IllegalArgumentException; 
     32     * @param instance the instance of add the child to 
     33     * @param child    the child to be added 
     34     *  
     35     * @throws IllegalArgumentException as described 
     36     */ 
     37    void addChild(ISequenceInstance instance, ITaskInstance child) throws IllegalArgumentException; 
     38 
     39    /** 
     40     * <p> 
     41     * adds a child to an iteration instance. May ensure, that the child is a valid child 
     42     * considering the task model of the parent. In that case, an IllegalArgumentException is 
     43     * thrown. 
     44     * </p> 
     45     *  
     46     * @param instance the instance of add the child to 
     47     * @param child    the child to be added 
     48     *  
     49     * @throws IllegalArgumentException as described 
     50     */ 
     51    void addChild(IIterationInstance instance, ITaskInstance child) throws IllegalArgumentException; 
     52 
     53    /** 
     54     * <p> 
     55     * sets the child of a selection instance. May ensure, that the child is a valid child 
     56     * considering the task model of the parent. In that case, an IllegalArgumentException is 
     57     * thrown. 
     58     * </p> 
     59     *  
     60     * @param instance the instance of add the child to 
     61     * @param child    the child to be added 
     62     *  
     63     * @throws IllegalArgumentException as described 
     64     */ 
     65    void setChild(ISelectionInstance instance, ITaskInstance child) throws IllegalArgumentException; 
     66 
     67    /** 
     68     * <p> 
     69     * sets the child of an optional instance. May ensure, that the child is a valid child 
     70     * considering the task model of the parent. In that case, an IllegalArgumentException is 
     71     * thrown. 
     72     * </p> 
     73     *  
     74     * @param instance the instance of add the child to 
     75     * @param child    the child to be added 
     76     *  
     77     * @throws IllegalArgumentException as described 
     78     */ 
     79    void setChild(IOptionalInstance instance, ITaskInstance child) throws IllegalArgumentException; 
    3880 
    3981    /** 
     
    215257    void replaceChild(ISelection parent, ITask oldChild, ITask newChild); 
    216258 
    217     /** 
    218      * <p> 
    219      * sets the description of a task 
    220      * </p> 
    221      *  
    222      * @param task        the task to set the description of 
    223      * @param description the new description of the task 
    224      */ 
    225     void setDescription(ITask task, String description); 
    226  
    227259} 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/ITaskFactory.java

    r1191 r1294  
    1717import java.util.List; 
    1818 
    19 import de.ugoe.cs.autoquest.eventcore.IEventTarget; 
    20 import de.ugoe.cs.autoquest.eventcore.IEventType; 
     19import de.ugoe.cs.autoquest.eventcore.Event; 
    2120 
    2221/** 
     
    3130    /** 
    3231     * <p> 
    33      * creates a new event task with the given type and target 
     32     * creates a new event task with the given description 
    3433     * </p> 
    3534     *  
    36      * @param eventType   the type of the event represented by the task 
    37      * @param eventTarget the target of the event represented by the task 
     35     * @param description the description for the represented events 
    3836     *  
    3937     * @return the event task 
    4038     */ 
    41     IEventTask createNewEventTask(IEventType eventType, IEventTarget eventTarget); 
     39    IEventTask createNewEventTask(String description); 
    4240 
    4341    /** 
     
    7977    /** 
    8078     * <p> 
    81      * creates a new task instance with the given task as its model 
     79     * creates a new task instance with the given task as its model representing the provided event 
    8280     * </p> 
    8381     *  
    84      * @param task the model of the task instance to be created 
     82     * @param task  the model of the task instance to be created 
     83     * @param event the event represented by the task instance 
    8584     *  
    8685     * @return the task instance 
    8786     */ 
    88     ITaskInstance createNewTaskInstance(ITask task); 
     87    IEventTaskInstance createNewTaskInstance(IEventTask task, Event event); 
    8988 
    9089    /** 
    9190     * <p> 
    92      * creates a new empty task instance list 
     91     * creates a new task instance with the given sequence as its model 
    9392     * </p> 
    9493     *  
    95      * @return the task instance list 
     94     * @param sequence the model of the task instance to be created 
     95     *  
     96     * @return the task instance 
    9697     */ 
    97     ITaskInstanceList createNewTaskInstanceList(); 
     98    ISequenceInstance createNewTaskInstance(ISequence sequence); 
     99 
     100    /** 
     101     * <p> 
     102     * creates a new task instance with the given iteration as its model 
     103     * </p> 
     104     *  
     105     * @param iteration the model of the task instance to be created 
     106     *  
     107     * @return the task instance 
     108     */ 
     109    IIterationInstance createNewTaskInstance(IIteration iteration); 
     110 
     111    /** 
     112     * <p> 
     113     * creates a new task instance with the given optional as its model 
     114     * </p> 
     115     *  
     116     * @param optional the model of the task instance to be created 
     117     *  
     118     * @return the task instance 
     119     */ 
     120    IOptionalInstance createNewTaskInstance(IOptional optional); 
     121 
     122    /** 
     123     * <p> 
     124     * creates a new task instance with the given selection as its model 
     125     * </p> 
     126     *  
     127     * @param selection the model of the task instance to be created 
     128     *  
     129     * @return the task instance 
     130     */ 
     131    ISelectionInstance createNewTaskInstance(ISelection selection); 
    98132 
    99133    /** 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/ITaskInstance.java

    r1177 r1294  
    1515package de.ugoe.cs.autoquest.tasktrees.treeifc; 
    1616 
    17 import java.util.List; 
     17import java.io.Serializable; 
    1818 
    1919/** 
    2020 * <p> 
    2121 * a task instance represents the execution of a specific task within a user session. A task 
    22  * instance is always related to the task that was executed. A task instance may have children 
    23  * but only if its related task allows to have children. For example, if the represented task is 
    24  * a sequence then task instance has children and these are instances of the tasks being the 
    25  * children of the related sequence. 
    26  * </p> 
    27  * <p> 
    28  * An instance of a sequence has the same number of children as the related sequence. An instance 
    29  * of a selection has only one child which is an instance of exactly one variant contained in the 
    30  * related selection. An instance of an iteration has zero or more instances of the same task 
    31  * as children where the task is the child of the related iteration. An instance of an optional 
    32  * has zero or one child where the task related to child is the child of the optional. A task 
    33  * instance related to an event task does not have children. 
     22 * instance is always related to the task that was executed. 
    3423 * </p> 
    3524 *  
    3625 * @author Patrick Harms 
    3726 */ 
    38 public interface ITaskInstance extends ITaskInstanceList { 
    39  
    40     /** 
    41      * <p> 
    42      * returns the children of the task instance if any. See class description for how many 
    43      * children can be expected. May return null. 
    44      * </p> 
    45      *  
    46      * @return as described 
    47      */ 
    48     public List<ITaskInstance> getChildren(); 
     27public interface ITaskInstance extends Serializable, Cloneable { 
    4928 
    5029    /** 
  • trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeifc/ITaskInstanceList.java

    r1177 r1294  
    1919/** 
    2020 * <p> 
    21  * represents a serializable, clonable, iterable representation of a read only list of task 
     21 * represents a serializable and iterable representation of a read only list of task 
    2222 * instances. The list is ordered. It does not provide methods for changing it. 
    2323 * </p> 
     
    2525 * @author Patrick Harms 
    2626 */ 
    27 public interface ITaskInstanceList extends Serializable, Cloneable, Iterable<ITaskInstance> { 
     27public interface ITaskInstanceList extends Serializable, Iterable<ITaskInstance> { 
    2828 
    2929    /** 
     
    4848    public int size(); 
    4949 
    50     /** 
    51      * <p> 
    52      * clones a task instance list by creating exact clones of each contained instance in their 
    53      * order 
    54      * </p> 
    55      *  
    56      * @return a clone of the task instance list 
    57      */ 
    58     public ITaskInstanceList clone(); 
    59    
    6050} 
Note: See TracChangeset for help on using the changeset viewer.