korat.utils.cv
Interface ICVFinder

All Known Implementing Classes:
CVFinder, CVFinderDelta

public interface ICVFinder

Interface for searching for candidate vectors in the given candidate-vectors-file.

Author:
Aleksandar Milicevic

Method Summary
 void close()
          Closes underlying files, streams, etc.
 long find(int[] cv)
          Finds the index for the given candidate vector.
 long[] find(int[][] cvs)
          Finds indexes for the given candidate vectors
 long getNumCVs()
          Gets number of candidate vectors in a file
 int getNumElemsPerCV()
          Gets number of elements per candidate vector
 boolean isPredicateOK()
          Call this method immediately after calling readCV to find out if the read vector passes predicate check or not
 int[] readCV(long idx)
          Reads idx-th candidate vector from file
 

Method Detail

getNumCVs

long getNumCVs()
Gets number of candidate vectors in a file

Returns:
number of candidate vectors

getNumElemsPerCV

int getNumElemsPerCV()
Gets number of elements per candidate vector

Returns:
number of elements per candidate vector

readCV

int[] readCV(long idx)
             throws IOException
Reads idx-th candidate vector from file

Parameters:
idx - index of candidate vector in the file
Returns:
candidate vector on the idx-th position in the file
Throws:
IOException - if an I/O error occurs

isPredicateOK

boolean isPredicateOK()
Call this method immediately after calling readCV to find out if the read vector passes predicate check or not

Returns:
is predicate ok or not for the last read candidate vector

find

long find(int[] cv)
          throws IOException
Finds the index for the given candidate vector.

Parameters:
cv - candidate vector to search for
Returns:
index of the given candidate vector in the file if vector exists of -1 otherwise
Throws:
IOException - if an I/O error occurs

find

long[] find(int[][] cvs)
            throws IOException
Finds indexes for the given candidate vectors

Parameters:
cvs - candidate vectors to search for
Returns:
indices of the given candidate vectors in the file
Throws:
IOException - if an I/O error occurs

close

void close()
           throws IOException
Closes underlying files, streams, etc.

Throws:
IOException