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

Last change on this file since 1401 was 1401, checked in by pharms, 10 years ago
File size: 1.6 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.ITaskInstance;
19
20/**
21 * <p>
22 * symbol comparator implementation for task instances considering to task instances as equal if
23 * they refer to the identical task object (comparison of object references).
24 * </p>
25 */
26class TaskIdentityComparator extends TaskInstanceComparator {
27
28    /**  */
29    private static final long serialVersionUID = 1L;
30   
31    /**
32     * <p>
33     * initializes the parent class with the task equality {@link TaskEquality#IDENTICAL}.
34     * </p>
35     */
36    public TaskIdentityComparator() {
37        super(TaskEquality.IDENTICAL);
38    }
39   
40    /* (non-Javadoc)
41     * @see SymbolComparator#equals(Object, Object)
42     */
43    @Override
44    public boolean equals(ITaskInstance taskInstance1, ITaskInstance taskInstance2) {
45        return taskInstance1.getTask() == taskInstance2.getTask();
46    }       
47
48}
Note: See TracBrowser for help on using the repository browser.