CorpusRanker.java revision ce4cdcf739b57563ddcdbed6944128b8c1f7522a
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.quicksearchbox;
18
19import android.database.DataSetObserver;
20
21import java.util.List;
22
23/**
24 * Orders corpora by importance.
25 */
26public interface CorpusRanker {
27
28    /**
29     * Gets a an ordered list of corpora.
30     *
31     * @return The most important corpora come first in the list. Callers should not mofify the
32     *         returned list.
33     */
34    List<Corpus> getRankedCorpora();
35
36    /**
37     * Registers an observer that is called when the corpus list changes.
38     *
39     * @param observer gets notified when the corpus list changes.
40     */
41    void registerDataSetObserver(DataSetObserver observer);
42
43    /**
44     * Unregisters an observer that has previously been registered with
45     * {@link #registerDataSetObserver(DataSetObserver)}
46     *
47     * @param observer the observer to unregister.
48     */
49    void unregisterDataSetObserver(DataSetObserver observer);
50
51}
52