[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] | 15 | package de.ugoe.cs.autoquest.tasktrees.treeimpl; |
---|
[439] | 16 | |
---|
[1146] | 17 | import java.util.List; |
---|
| 18 | |
---|
[922] | 19 | import de.ugoe.cs.autoquest.eventcore.IEventTarget; |
---|
| 20 | import de.ugoe.cs.autoquest.eventcore.IEventType; |
---|
| 21 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; |
---|
| 22 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; |
---|
[1126] | 23 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; |
---|
[922] | 24 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; |
---|
| 25 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; |
---|
[1146] | 26 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; |
---|
| 27 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; |
---|
| 28 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstanceList; |
---|
| 29 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; |
---|
| 30 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; |
---|
| 31 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession; |
---|
[439] | 32 | |
---|
| 33 | /** |
---|
[1216] | 34 | * <p> |
---|
| 35 | * this is the default implementation of the interface {@link ITaskFactory}. It |
---|
| 36 | * does not do anything fancy except implementing the interface. It instantiates the other |
---|
| 37 | * implementations of the tree ifc in this package. |
---|
| 38 | * </p> |
---|
[439] | 39 | * |
---|
[1216] | 40 | * @author Patrick Harms |
---|
[439] | 41 | */ |
---|
[1146] | 42 | public class TaskFactory implements ITaskFactory { |
---|
[439] | 43 | |
---|
[1216] | 44 | /* (non-Javadoc) |
---|
| 45 | * @see ITaskFactory#createNewEventTask(IEventType, IEventTarget) |
---|
[557] | 46 | */ |
---|
| 47 | @Override |
---|
| 48 | public IEventTask createNewEventTask(IEventType eventType, IEventTarget eventTarget) { |
---|
| 49 | return new EventTask(eventType, eventTarget); |
---|
| 50 | } |
---|
[439] | 51 | |
---|
[1216] | 52 | /* (non-Javadoc) |
---|
| 53 | * @see ITaskFactory#createNewSequence() |
---|
[557] | 54 | */ |
---|
| 55 | @Override |
---|
| 56 | public ISequence createNewSequence() { |
---|
| 57 | return new Sequence(); |
---|
| 58 | } |
---|
[439] | 59 | |
---|
[1216] | 60 | /* (non-Javadoc) |
---|
| 61 | * @see ITaskFactory#createNewIteration() |
---|
[557] | 62 | */ |
---|
| 63 | @Override |
---|
| 64 | public IIteration createNewIteration() { |
---|
| 65 | return new Iteration(); |
---|
| 66 | } |
---|
[439] | 67 | |
---|
[1126] | 68 | /* (non-Javadoc) |
---|
[1216] | 69 | * @see ITaskFactory#createNewOptional() |
---|
[1126] | 70 | */ |
---|
| 71 | @Override |
---|
| 72 | public IOptional createNewOptional() { |
---|
| 73 | return new Optional(); |
---|
| 74 | } |
---|
| 75 | |
---|
[1216] | 76 | /* (non-Javadoc) |
---|
| 77 | * @see ITaskFactory#createNewSelection() |
---|
[557] | 78 | */ |
---|
| 79 | @Override |
---|
| 80 | public ISelection createNewSelection() { |
---|
| 81 | return new Selection(); |
---|
| 82 | } |
---|
[439] | 83 | |
---|
[1146] | 84 | /* (non-Javadoc) |
---|
[1216] | 85 | * @see ITaskFactory#createNewTaskInstance(ITask) |
---|
[557] | 86 | */ |
---|
| 87 | @Override |
---|
[1146] | 88 | public ITaskInstance createNewTaskInstance(ITask task) { |
---|
| 89 | return new TaskInstance(task); |
---|
[557] | 90 | } |
---|
[439] | 91 | |
---|
[1146] | 92 | /* (non-Javadoc) |
---|
[1216] | 93 | * @see ITaskFactory#createNewTaskInstanceList() |
---|
[1146] | 94 | */ |
---|
| 95 | @Override |
---|
| 96 | public ITaskInstanceList createNewTaskInstanceList() { |
---|
| 97 | return new TaskInstance(new Sequence()); |
---|
| 98 | } |
---|
| 99 | |
---|
| 100 | /* (non-Javadoc) |
---|
[1216] | 101 | * @see ITaskFactory#createUserSession() |
---|
[1146] | 102 | */ |
---|
| 103 | @Override |
---|
| 104 | public IUserSession createUserSession() { |
---|
| 105 | return new UserSession(); |
---|
| 106 | } |
---|
| 107 | |
---|
| 108 | /* (non-Javadoc) |
---|
[1216] | 109 | * @see ITaskFactory#createTaskModel(List<IUserSession>) |
---|
[1146] | 110 | */ |
---|
| 111 | @Override |
---|
| 112 | public ITaskModel createTaskModel(List<IUserSession> userSessions) { |
---|
| 113 | return new TaskModel(userSessions); |
---|
| 114 | } |
---|
| 115 | |
---|
[439] | 116 | } |
---|