/* $Id: SearchResult.java 609 2012-11-29 10:22:01Z ohura $ */
package smart_gs.text_search.logical;

import smart_gs.text_search.swingui.*;

public class SearchResult {

	private String queryText;
	private String documentURI;
	private int resultIndex;	//検索にヒットした単語が テキスト の何文字目にあるか
	private TextToShow textToShow;
	private boolean isSelected = false;
	private boolean wasShown = false;
//	protected Spread spread;
	
	public SearchResult(){
	}
	public void setQueryText(String queryText){
		this.queryText = queryText;
	}
	public void setTextToShow(TextToShow textToShow){
		this.textToShow = textToShow;
	}
	public TextToShow getTextToShow(){
		return this.textToShow;
	}
	public void setDocumentURI(String uri) {
		this.documentURI = uri;
	}

	public void setIndex(int index){
		this.resultIndex = index;
	}
	public void setResult(String queryText,String documentURI,int index){
		this.setQueryText(queryText);
		this.setDocumentURI(documentURI);
		this.setIndex(index);
	}
	public String getQueryText(){
		return queryText;
	}
	public String getDocumentURL(){
		return documentURI;
	}
//	public void setSpread(Spread spread){
//		this.spread = spread;
//	}
//	public Spread getSpread(){
//		return 	spread;
//	}

	public boolean isInAnIDAT(){
		String tmp = documentURI.substring(8);
		return tmp.startsWith("firstIdat") || tmp.startsWith("secondIdat") || tmp.startsWith("thirdIdat");
	}

	public int getIndex(){
		return resultIndex;
	}
	public void setWasShown(boolean wasShown){
		this.wasShown = wasShown;
	}
	public boolean wasShown(){
		return this.wasShown;
	}
	public void setSelected(boolean isSelected){
		this.isSelected = isSelected;
	}
	public boolean isSelected(){
		return this.isSelected;
	}
}
