source: trunk/autoquest-core-usageprofiles/src/main/java/de/ugoe/cs/autoquest/usageprofiles/SymbolComparator.java @ 1282

Last change on this file since 1282 was 1282, checked in by pharms, 11 years ago
  • added support for symbol management strategy in tries, especially for storing them
  • adapted comparator approach accordingly
  • provided default implementation for symbol management strategies
  • added, extended and improved java doc
File size: 1.5 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.usageprofiles;
16
17import java.io.Serializable;
18
19/**
20 * <p>
21 * This interface can be used for implementing comparison strategies for symbols.
22 * </p>
23 *
24 * @author Patrick Harms
25 */
26public interface SymbolComparator<T> extends Serializable {
27   
28    /**
29     * <p>
30     * compares two symbols and returns true, if the concrete comparison strategy sees both
31     * symbols as equal. The method must be commutative and transitive, i.e.,
32     * <code>equals(symbol1, symbol2) == equals(symbol2, symbol1)</code> and
33     * <code>if (equals(symbol1, symbol2) && equals(symbol2, symbol3)) then
34     * equals(symbol1, symbol3)</code>.
35     * </p>
36     *
37     * @param symbol1 the first symbol to be compared
38     * @param symbol2 the second symbol to be compared
39     *
40     * @return true if the comparison strategy sees both symbols as equal, false else.
41     */
42    public boolean equals(T symbol1, T symbol2);
43
44}
Note: See TracBrowser for help on using the repository browser.