[1282] | 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 | import java.io.Serializable; |
---|
| 18 | |
---|
| 19 | /** |
---|
| 20 | * <p> |
---|
| 21 | * The symbol strategy is used in a trie for comparing symbols and for storing symbols in maps. |
---|
| 22 | * The symbol strategy can be changed to improve the performance of the trie depending on the type |
---|
| 23 | * of symbols. |
---|
| 24 | * </p> |
---|
| 25 | * |
---|
| 26 | * @author Patrick Harms |
---|
| 27 | * |
---|
| 28 | * @param <T> |
---|
| 29 | * Type of the symbols that are compared and stored |
---|
| 30 | * @see Trie |
---|
| 31 | */ |
---|
| 32 | public interface SymbolStrategy<T> extends Serializable { |
---|
| 33 | |
---|
| 34 | /** |
---|
| 35 | * <p> |
---|
| 36 | * Returns a comparator for symbols that can be used to compare two symbols |
---|
| 37 | * </p> |
---|
| 38 | * |
---|
| 39 | * @return a comparator for symbols |
---|
| 40 | * |
---|
| 41 | * @see SymbolComparator |
---|
| 42 | */ |
---|
| 43 | public SymbolComparator<T> getSymbolComparator(); |
---|
| 44 | |
---|
| 45 | /** |
---|
| 46 | * <p> |
---|
| 47 | * returns a new empty map for storing symbols and associated values. The symbols are the |
---|
| 48 | * keys of the map. |
---|
| 49 | * </p> |
---|
| 50 | * |
---|
| 51 | * @return as described |
---|
| 52 | * |
---|
| 53 | * @see SymbolMap |
---|
| 54 | */ |
---|
| 55 | public <V> SymbolMap<T, V> createSymbolMap(); |
---|
| 56 | |
---|
| 57 | /** |
---|
| 58 | * <p> |
---|
| 59 | * returns a copy of the provided map for storing symbols and associated values. |
---|
| 60 | * </p> |
---|
| 61 | * |
---|
| 62 | * @return as described |
---|
| 63 | * |
---|
| 64 | * @see SymbolMap |
---|
| 65 | */ |
---|
| 66 | public <V> SymbolMap<T, V> copySymbolMap(SymbolMap<T, V> other); |
---|
| 67 | |
---|
| 68 | } |
---|