public class Result extends Object implements Serializable, Comparable<Result>
Modifier and Type | Field and Description |
---|---|
int |
score
The score for this Result
|
static long |
serialVersionUID |
String |
url
URL of this Result
|
int |
urlID
ID for this URL
|
Constructor and Description |
---|
Result(String url,
int urlID)
Constructor for a Result.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Result candidate)
When we have finished building our Results list, we need to
sort the list by each Results score so that we can return
the ranked list.
|
boolean |
equals(Object obj)
Override for the equals() method so that
contains() will do proper comparison for ArrayList
|
int |
getScore()
Get the score of this Result
|
String |
getURL()
Get the URL of this Result as a String
|
int |
getURLID()
Get the URL ID for this Result.
|
void |
incrementScore()
Update the score by just one.
|
void |
updateScore(int score)
Update the score for this reference by a given amount.
|
public static final long serialVersionUID
public String url
public int score
public int urlID
public Result(String url, int urlID)
url
- String representation of the ResulturlID
- ID of the Pagepublic void updateScore(int score)
score
- score to add to the existing scorepublic void incrementScore()
public int getScore()
public String getURL()
public int getURLID()
public boolean equals(Object obj)
equals
in class Object
obj
- Result object to be comparedpublic int compareTo(Result candidate)
compareTo
in interface Comparable<Result>
candidate
- Result being compared to 'this' Result