/* $Id: DocumentSearcherDummy.java 125 2011-03-09 09:49:51Z ohura $ */
/*
 * 作成日： 2006/08/25
 */
package jp.ac.hokudai.meme.core_smart_gs.searcher;

import java.awt.Rectangle;
import java.io.*;
import java.util.*;

import jp.ac.hokudai.meme.core_smart_gs.InvalidDataFormatException;

public class DocumentSearcherDummy extends DocumentSearcher{
    
    public DocumentSearcherDummy(){
        super();
    }
    
    protected ResultIndex searchStart(double[][] dscData, int[] index) {
        ArrayList slitList = dscData_.getSlitDataList_();
        Random random = new Random();
        int pageIdx = random.nextInt(slitList.size());
        Rectangle[] page = (Rectangle[]) slitList.get(pageIdx);
        
        int start = random.nextInt(page.length);
        int length = random.nextInt(30);
        
        ArrayList dummyHit = new ArrayList();
        for (int i = 0; i < length; i++) {
            dummyHit.add(new PagedRect(pageIdx, page[start + i]));
        }
        ResultRects result = new ResultRects();
//        result.addResult(dummyHit);
        return null;
    }
    
    /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
        File inFile = new File("D:/sandbox/core_smart_gs/2006-08-26/test2/Cod_Ms_Hilbert_600_0-1.dsc");
        File[] addFiles = {inFile};
        DocumentSearcher searcher = new DocumentSearcherDummy();
        File[] fileList = null;
        try {
            fileList = searcher.addDscFile(addFiles);
        } catch (InvalidDataFormatException e) {
            // TODO 自動生成された catch ブロック
            e.printStackTrace();
        }
        System.out.println(fileList);
    }
    
}
