001    /*
002     * Copyright (c) 1998-2014 ChemAxon Ltd. All Rights Reserved.
003     *
004     * This software is the confidential and proprietary information of
005     * ChemAxon. You shall not disclose such Confidential Information
006     * and shall use it only in accordance with the terms of the agreements
007     * you entered into with ChemAxon.
008     *
009     */
010    package com.chemaxon.overlap;
011    
012    import com.google.common.annotations.Beta;
013    import java.io.Serializable;
014    
015    /**
016     * Results of K nearest neighbors calculations.
017     *
018     * <p>
019     * This result object holds ordered target-query-dissimilarity triplets.</p>
020     *
021     * @author Gabor Imre
022     */
023    @Beta
024    public interface KnnResults extends Serializable {
025    
026        /**
027         * Value of k.
028         *
029         * @return Number of stored neighbors for each query
030         */
031        int getK();
032    
033        /**
034         * Number of queries stored.
035         *
036         * @return Number of queries stored
037         */
038        int getQueryCount();
039    
040        /**
041         * Query ID.
042         *
043         * @param index Index
044         * @return Query ID for the given index
045         */
046        int getQuery(int index);
047    
048        /**
049         * ID of the nearest neighbors of query.
050         *
051         * @param index Index
052         * @return Nearest neighbor IDs for the given query
053         */
054        int[] getNeighbors(int index);
055    
056        /**
057         * Dissimilarity.
058         *
059         * @param index Index
060         * @return Dissimilarities of the nearest neighbors
061         */
062        double[] getDissimilarities(int index);
063    }