1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package net.sourceforge.phpdt.internal.ui.text.spelling.engine;
15 * Ranked word proposal for quick fix and content assist.
19 public class RankedWordProposal implements Comparable {
25 private final String fText;
28 * Creates a new ranked word proposal.
31 * The text of this proposal
33 * The rank of this proposal
35 public RankedWordProposal(final String text, final int rank) {
41 * @see java.lang.Comparable#compareTo(java.lang.Object)
43 public final int compareTo(Object object) {
45 final RankedWordProposal word = (RankedWordProposal) object;
46 final int rank = word.getRank();
58 * @see java.lang.Object#equals(java.lang.Object)
60 public final boolean equals(Object object) {
62 if (object instanceof RankedWordProposal)
63 return object.hashCode() == hashCode();
69 * Returns the rank of the word
71 * @return The rank of the word
73 public final int getRank() {
78 * Returns the text of this word.
80 * @return The text of this word
82 public final String getText() {
87 * @see java.lang.Object#hashCode()
89 public final int hashCode() {
90 return fText.hashCode();
94 * Sets the rank of the word.
99 public final void setRank(final int rank) {