source: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/treeimpl/EventTask.java @ 1167

Last change on this file since 1167 was 1157, checked in by adeicke, 11 years ago

Added Visitor pattern for tasks.

  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[1113]1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
[922]15package de.ugoe.cs.autoquest.tasktrees.treeimpl;
[439]16
[922]17import de.ugoe.cs.autoquest.eventcore.IEventTarget;
18import de.ugoe.cs.autoquest.eventcore.IEventType;
19import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask;
[1157]20import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskVisitor;
[439]21
22/**
23 * TODO comment
[557]24 *
[439]25 * @version $Revision: $ $Date: $
[557]26 * @author 2011, last modified by $Author: $
[439]27 */
[1146]28class EventTask extends Task implements IEventTask {
[557]29   
[1146]30    /**  */
31    private static final long serialVersionUID = 1L;
32
[557]33    /** */
34    private IEventType eventType;
[439]35
[557]36    /** */
37    private IEventTarget eventTarget;
[439]38
[557]39    /**
40     * @param eventType
41     * @param eventTarget
42     */
43    EventTask(IEventType eventType, IEventTarget eventTarget) {
[1146]44        super.setDescription(eventType.toString() + " executed on " + eventTarget);
[557]45        this.eventType = eventType;
46        this.eventTarget = eventTarget;
47    }
[439]48
[557]49    /**
50     * @return Returns the interaction.
51     */
52    public IEventType getEventType() {
53        return eventType;
54    }
[439]55
[557]56    /**
57     * @return Returns the GUIElement.
58     */
59    public IEventTarget getEventTarget() {
60        return eventTarget;
[439]61    }
[557]62
63    /*
64     * (non-Javadoc)
65     *
66     * @see de.harms.tasktrees.TreeNode#clone()
67     */
68    @Override
69    public EventTask clone() {
70        // Event type and target are unchangeable and do not need to be cloned
71        return (EventTask) super.clone();
[1157]72    }
73
74    /* (non-Javadoc)
75     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask#accept(de.ugoe.cs.autoquest.tasktrees.treeifc.TaskVisitor)
76     */
77    @Override
78    public void accept(ITaskVisitor visitor) {
79        visitor.visit(this);
[557]80    }
[439]81
82}
Note: See TracBrowser for help on using the repository browser.