View Javadoc

1   package org.musicontroller.core.searching;
2   
3   /**
4    * Class that represents the variable documents that can be found
5    * by the MCSearcher
6    * @author Varienaja
7    *
8    */
9   public class Item {
10  	
11  	private long _id;
12  	private String _name;
13  	private String _kind;
14  	private int _score;
15  	private String _excerpt;
16  	
17  	public Item(long id, String name, String kind, float score, String excerpt) {
18  		_id = id;
19  		_name = name;
20  		_kind = kind;
21  		_score = 100 * (int) score;
22  		_excerpt = excerpt;
23  	}
24  	
25  	public long getItemId() {
26  		return _id;
27  	}
28  	
29  	public String getItemName() {
30  		return _name;
31  	}
32  	
33  	public String getItemKind() {
34  		return _kind;
35  	}
36  	
37  	public String getScore() {
38  		return _score + "%";
39  	}
40  	
41  	public String getExcerpt() {
42  		return _excerpt;
43  	}
44  	
45  	public String toString() {
46  		return "("+_id +") "+_kind + " " + _name;
47  	}
48  
49  	/**
50  	 * Set a flag that indicates that this Item points to a null-object.
51  	 */
52  	public void setNullItem() {
53  		_kind = "";
54  	}
55  
56  }