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

Last change on this file since 1255 was 1255, checked in by pharms, 11 years ago
  • adapted logging
  • Property svn:executable set to *
File size: 2.9 KB
Line 
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
15package de.ugoe.cs.autoquest.tasktrees.treeimpl;
16
17import de.ugoe.cs.autoquest.eventcore.IEventTarget;
18import de.ugoe.cs.autoquest.eventcore.IEventType;
19import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask;
20import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskVisitor;
21
22/**
23 * <p>
24 * this is the default implementation of the interface {@link IEventTask}. It does not do anything
25 * fancy except implementing the interface.
26 * </p>
27 *
28 * @author Patrick Harms
29 */
30class EventTask extends Task implements IEventTask {
31   
32    /**
33     * <p>
34     * default serial version UID
35     * </p>
36     */
37    private static final long serialVersionUID = 1L;
38
39    /**
40     * <p>
41     * the type of the represented event
42     * </p>
43     */
44    private IEventType eventType;
45
46    /**
47     * <p>
48     * the target of the represented event
49     * </p>
50     */
51    private IEventTarget eventTarget;
52
53    /**
54     * <p>
55     * simple constructor initializing this task with an event type and an event target
56     * </p>
57     *
58     * @param eventType   the type of the represented event
59     * @param eventTarget the target of the represented event
60     */
61    EventTask(IEventType eventType, IEventTarget eventTarget) {
62        super.setDescription(eventType.toString() + " \u21D2 " + eventTarget);
63        this.eventType = eventType;
64        this.eventTarget = eventTarget;
65    }
66
67    /* (non-Javadoc)
68     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask#getEventType()
69     */
70    @Override
71    public IEventType getEventType() {
72        return eventType;
73    }
74
75    /* (non-Javadoc)
76     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask#getEventTarget()
77     */
78    @Override
79    public IEventTarget getEventTarget() {
80        return eventTarget;
81    }
82
83    /* (non-Javadoc)
84     * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.Task#clone()
85     */
86    @Override
87    public EventTask clone() {
88        // Event type and target are unchangeable and do not need to be cloned
89        return (EventTask) super.clone();
90    }
91
92    /* (non-Javadoc)
93     * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.Task#accept(ITaskVisitor)
94     */
95    @Override
96    public void accept(ITaskVisitor visitor) {
97        visitor.visit(this);
98    }
99
100}
Note: See TracBrowser for help on using the repository browser.