[1060] | 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.usageprofiles; |
---|
| 16 | |
---|
| 17 | /** |
---|
| 18 | * <p> |
---|
| 19 | * Default implementation for the {@link SymbolComparator} using the equals method of the provided |
---|
| 20 | * symbols for comparison. The {@link #equals(Object, Object)} method will also return true if |
---|
| 21 | * both symbols are <code>null</code> |
---|
| 22 | * </p> |
---|
| 23 | * |
---|
| 24 | * @author Patrick Harms |
---|
| 25 | */ |
---|
| 26 | public class DefaultSymbolComparator<T> implements SymbolComparator<T> { |
---|
| 27 | |
---|
[1196] | 28 | /** */ |
---|
| 29 | private static final long serialVersionUID = 1L; |
---|
| 30 | |
---|
[1060] | 31 | /* (non-Javadoc) |
---|
| 32 | * @see de.ugoe.cs.autoquest.tasktrees.temporalrelation.SymbolComparator#equals(java.lang.Object, java.lang.Object) |
---|
| 33 | */ |
---|
| 34 | @Override |
---|
| 35 | public boolean equals(T symbol1, T symbol2) { |
---|
| 36 | if (symbol1 == null) { |
---|
| 37 | return (symbol2 == null); |
---|
| 38 | } |
---|
| 39 | else { |
---|
| 40 | return symbol1.equals(symbol2); |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | } |
---|