nothing...
[serc.git] / Result.java
bloba5d64469ca4beb1a7543fc8affee9bf9a12ef5bf
1 /** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Copyright 2008 Ledermueller Achim
4 * serc is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
18 import java.util.Vector;
19 import java.net.URL;
21 class Result {
22 public Vector<URL> urls;
23 public static int counter = 0;
24 private int rank;
26 //Resolver sets this var.
27 private URL relevantUrl;
28 private URL relevantDomain;
29 private URL relevantFile;
31 Result(){
32 urls = new Vector<URL>();
33 counter++;
34 rank = counter;
37 Result(URL url) {
38 urls = new Vector<URL>();
39 urls.add(url);
40 counter++;
41 rank = counter;
44 public void addUrl(URL url) {
45 urls.add(url);
48 public String toString() {
49 String str = "------Result------\n";
50 for(int i=0; i<urls.size(); i++) {
51 str += "Result.url: " + i +"\n";
52 str += ">> " + urls.get(i).getHost() + "\n";
53 str += ">> " + urls.get(i).getFile() + "\n";
54 str += ">> " + urls.get(i).getQuery() + "\n";
55 str += ">>\n";
57 return str;
60 public boolean isEmpty() {
61 if(urls.size() == 0)
62 return true;
63 else
64 return false;
67 public URL getRelevantUrl() {
68 return relevantUrl;
70 public void setRelevantUrl(URL url) {
71 relevantUrl = url;
74 public URL getRelevantDomain() {
75 return relevantDomain;
77 public void setRelevantDomain(URL url) {
78 relevantDomain = url;
81 public URL getRelevantFile() {
82 return relevantFile;
84 public void setRelevantFile(URL url) {
85 relevantFile = url;
87 public int getRank() {
88 return rank;