1 package com
.swabunga
.spell
.engine
;
3 import java
.util
.Comparator
;
5 /** The Word object holds both the string and the score.
6 * <p>This class is now immutable.
9 public class Word
implements Comparator
{
16 public Word(String word
, int score
) {
21 /** The comparator interface*/
22 public int compare(Object o1
, Object o2
) {
23 if (((Word
) o1
).getScore() < ((Word
) o2
).getScore()) return -1;
24 if (((Word
) o1
).getScore() == ((Word
) o2
).getScore()) return 0;
28 public String
getWord() {
32 public int getScore() {
36 public String
toString() {