source: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskIdentityComparator.java @ 1767

Last change on this file since 1767 was 1767, checked in by pharms, 10 years ago
  • first version of merging similar task trees
File size: 1.8 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.temporalrelation;
16
17import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;
18import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
19import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
20
21/**
22 * <p>
23 * symbol comparator implementation for task instances considering to task instances as equal if
24 * they refer to the identical task object (comparison of object references).
25 * </p>
26 */
27class TaskIdentityComparator extends TaskInstanceComparator {
28
29    /**  */
30    private static final long serialVersionUID = 1L;
31   
32    /**
33     * <p>
34     * initializes the parent class with the task equality {@link TaskEquality#IDENTICAL}.
35     * </p>
36     */
37    public TaskIdentityComparator() {
38        super(TaskEquality.IDENTICAL);
39    }
40   
41    /* (non-Javadoc)
42     * @see SymbolComparator#equals(Object, Object)
43     */
44    @Override
45    public boolean equals(ITaskInstance taskInstance1, ITaskInstance taskInstance2) {
46        return equals(taskInstance1.getTask(), taskInstance2.getTask());
47    }
48
49    /* (non-Javadoc)
50     * @see TaskInstanceComparator#equals(ITask, ITask)
51     */
52    @Override
53    public boolean equals(ITask task1, ITask task2) {
54        return task1 == task2;
55    }       
56
57}
Note: See TracBrowser for help on using the repository browser.