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 | |
---|
15 | package de.ugoe.cs.autoquest.tasktrees.treeimpl; |
---|
16 | |
---|
17 | import de.ugoe.cs.autoquest.eventcore.Event; |
---|
18 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; |
---|
19 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; |
---|
20 | |
---|
21 | // TODO: Auto-generated Javadoc |
---|
22 | /** |
---|
23 | * <p> |
---|
24 | * Default implementation of {@link IEventTaskInstance}. |
---|
25 | * </p> |
---|
26 | * |
---|
27 | * @author Patrick Harms |
---|
28 | */ |
---|
29 | class EventTaskInstance extends TaskInstance implements IEventTaskInstance { |
---|
30 | |
---|
31 | /** <p> default serial version UID </p>. */ |
---|
32 | private static final long serialVersionUID = 1L; |
---|
33 | |
---|
34 | /** <p> the event represented by this instance </p>. */ |
---|
35 | private final Event event; |
---|
36 | |
---|
37 | /** |
---|
38 | * <p> |
---|
39 | * initializes this instance with the respective task model and the |
---|
40 | * represented event |
---|
41 | * </p>. |
---|
42 | * |
---|
43 | * @param task the task of which this is an instance |
---|
44 | * @param event the event represented by this instance |
---|
45 | */ |
---|
46 | EventTaskInstance(IEventTask task, Event event) { |
---|
47 | super(task); |
---|
48 | this.event = event; |
---|
49 | } |
---|
50 | |
---|
51 | /* |
---|
52 | * (non-Javadoc) |
---|
53 | * |
---|
54 | * @see de.ugoe.cs.autoquest.tasktrees.treeimpl.IEventTaskInstance#clone() |
---|
55 | */ |
---|
56 | @Override |
---|
57 | public synchronized IEventTaskInstance clone() { |
---|
58 | return (IEventTaskInstance) super.clone(); |
---|
59 | } |
---|
60 | |
---|
61 | /* |
---|
62 | * (non-Javadoc) |
---|
63 | * |
---|
64 | * @see de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance#getEvent() |
---|
65 | */ |
---|
66 | @Override |
---|
67 | public Event getEvent() { |
---|
68 | return event; |
---|
69 | } |
---|
70 | |
---|
71 | /* |
---|
72 | * (non-Javadoc) |
---|
73 | * |
---|
74 | * @see |
---|
75 | * de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance#getEventTask() |
---|
76 | */ |
---|
77 | @Override |
---|
78 | public IEventTask getEventTask() { |
---|
79 | return (IEventTask) super.getTask(); |
---|
80 | } |
---|
81 | |
---|
82 | } |
---|