source: trunk/autoquest-core-usability-evaluation/src/main/java/de/ugoe/cs/autoquest/usability/util/NullTask.java @ 1319

Last change on this file since 1319 was 1319, checked in by khartmann, 11 years ago
  • Reworked Filters to use the first instance of a task to provide type and target
  • Added a function to extract all tasks matching a given filter
  • Added simple console feedback for matched usability problems
  • Property svn:mime-type set to text/plain
File size: 2.7 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.usability.util;
16
17import java.util.Collection;
18import java.util.Collections;
19
20import org.apache.commons.lang.StringUtils;
21
22import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
23import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
24import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskVisitor;
25
26/**
27 * <p>
28 * Implementation of Null Object pattern {@link http://en.wikipedia.org/wiki/Null_Object_pattern}.
29 * </p>
30 *
31 * @author Alexander Deicke
32 */
33public class NullTask implements ITask {
34
35    private static final long serialVersionUID = 1236779392413787860L;
36
37    /*
38     * (non-Javadoc)
39     *
40     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITask#getId()
41     */
42    @Override
43    public int getId() {
44        return -1;
45    }
46
47    /*
48     * (non-Javadoc)
49     *
50     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#getName()
51     */
52    public String getName() {
53        return StringUtils.EMPTY;
54    }
55
56    /*
57     * (non-Javadoc)
58     *
59     * @see de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#getDescription()
60     */
61    public String getDescription() {
62        return StringUtils.EMPTY;
63    }
64
65    /*
66     * (non-Javadoc)
67     *
68     * @see
69     * de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#equals(de.ugoe.cs.autoquest.tasktrees
70     * .treeifc.ITaskTreeNode)
71     */
72    public boolean equals(ITask task) {
73        return false;
74    }
75
76    /*
77     * (non-Javadoc)
78     *
79     * @see java.lang.Object#clone()
80     */
81    @Override
82    public NullTask clone() {
83        return (NullTask) this;
84    }
85
86    /*
87     * (non-Javadoc)
88     *
89     * @see
90     * de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskTreeNode#accept(de.ugoe.cs.autoquest.tasktrees
91     * .treeifc.NodeVisitor)
92     */
93    public void accept(ITaskVisitor visitor) {
94        // do nothing
95    }
96
97    @Override
98    public Collection<ITaskInstance> getInstances() {
99        // return nothing
100        return Collections.emptyList();
101    }
102
103}
Note: See TracBrowser for help on using the repository browser.