View Javadoc

1   package net.obsearch.pivots;
2   
3   import net.obsearch.OB;
4   import net.obsearch.exception.OBException;
5   
6   
7   /*
8   OBSearch: a distributed similarity search engine
9   This project is to similarity search what 'bit-torrent' is to downloads.
10  Copyright (C)  2007 Arnoldo Jose Muller Molina
11  
12  This program is free software; you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or
15  (at your option) any later version.
16  
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  GNU General Public License for more details.
21  
22  You should have received a copy of the GNU General Public License along
23  with this program; if not, write to the Free Software Foundation, Inc.,
24  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.   
25  */
26  /**
27  * This interface is used by some pivot selectors to determine if
28  * a given object can be used as a pivot. There can be distance functions
29  * for which some objects are more expensive to compute than others.
30  * For example, trees. The bigger the tree is, the more expensive
31  * it is to compute its distance. 
32  * @param <O>
33  *            Type of object of the index to be analyzed.
34  * @author Arnoldo Jose Muller Molina
35  * @since 0.8
36  */
37  public interface Pivotable <O extends OB> {
38  
39      /**
40       * Returns true if the given object can be used as a pivot.
41       * @param object 
42       * @return true if the object should be used as a pivot
43       * @throws OBException If something goes wrong
44       */
45      boolean canBeUsedAsPivot(O object) throws OBException;
46      
47  }