xref: /OpenGrok/suggester/src/main/java/org/opengrok/suggest/popular/PopularityCounter.java (revision 5d9f3aa0ca3da3a714233f987fa732f62c0965f6)
1f0baaacdSAdam Hornáček /*
2f0baaacdSAdam Hornáček  * CDDL HEADER START
3f0baaacdSAdam Hornáček  *
4f0baaacdSAdam Hornáček  * The contents of this file are subject to the terms of the
5f0baaacdSAdam Hornáček  * Common Development and Distribution License (the "License").
6f0baaacdSAdam Hornáček  * You may not use this file except in compliance with the License.
7f0baaacdSAdam Hornáček  *
8f0baaacdSAdam Hornáček  * See LICENSE.txt included in this distribution for the specific
9f0baaacdSAdam Hornáček  * language governing permissions and limitations under the License.
10f0baaacdSAdam Hornáček  *
11f0baaacdSAdam Hornáček  * When distributing Covered Code, include this CDDL HEADER in each
12f0baaacdSAdam Hornáček  * file and include the License file at LICENSE.txt.
13f0baaacdSAdam Hornáček  * If applicable, add the following below this CDDL HEADER, with the
14f0baaacdSAdam Hornáček  * fields enclosed by brackets "[]" replaced with your own identifying
15f0baaacdSAdam Hornáček  * information: Portions Copyright [yyyy] [name of copyright owner]
16f0baaacdSAdam Hornáček  *
17f0baaacdSAdam Hornáček  * CDDL HEADER END
18f0baaacdSAdam Hornáček  */
19f0baaacdSAdam Hornáček 
20f0baaacdSAdam Hornáček /*
21*5d9f3aa0SAdam Hornáček  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
22f0baaacdSAdam Hornáček  */
23f0baaacdSAdam Hornáček package org.opengrok.suggest.popular;
24f0baaacdSAdam Hornáček 
25f0baaacdSAdam Hornáček import org.apache.lucene.util.BytesRef;
26f0baaacdSAdam Hornáček 
2762b91321SAdam Hornáček /**
2862b91321SAdam Hornáček  * Simple interface for accessing the popularity data for specific terms.
2962b91321SAdam Hornáček  */
30f0baaacdSAdam Hornáček @FunctionalInterface
31f0baaacdSAdam Hornáček public interface PopularityCounter {
32f0baaacdSAdam Hornáček 
3362b91321SAdam Hornáček     /**
3462b91321SAdam Hornáček      * For the term {@code key} returns the number the term was searched for.
3562b91321SAdam Hornáček      * @param key the term to retrieve data for
368749065aSAdam Hornáček      * @return number of times the {@code key} was searched for
3762b91321SAdam Hornáček      */
get(BytesRef key)38f0baaacdSAdam Hornáček     int get(BytesRef key);
39f0baaacdSAdam Hornáček 
40f0baaacdSAdam Hornáček }
41