1
/*******************************************************************************
2
* Copyright (c) 2000, 2008 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Corporation - initial API and implementation
10
* Sergey Prigogin (Google)
11
*******************************************************************************/
13
package org.eclipse.cdt.internal.ui.text.spelling.engine;
16
* Ranked word proposal for quick fix and content assist.
18
public class RankedWordProposal implements Comparable<RankedWordProposal> {
23
private final String fText;
26
* Creates a new ranked word proposal.
28
* @param text The text of this proposal
29
* @param rank The rank of this proposal
31
public RankedWordProposal(final String text, final int rank) {
37
* @see java.lang.Comparable#compareTo(java.lang.Object)
39
public final int compareTo(RankedWordProposal word) {
41
final int rank= word.getRank();
53
* @see java.lang.Object#equals(java.lang.Object)
56
public final boolean equals(Object object) {
57
if (object instanceof RankedWordProposal)
58
return object.hashCode() == hashCode();
64
* Returns the rank of the word
66
* @return The rank of the word
68
public final int getRank() {
73
* Returns the text of this word.
75
* @return The text of this word
77
public final String getText() {
82
* @see java.lang.Object#hashCode()
85
public final int hashCode() {
86
return fText.hashCode();
90
* Sets the rank of the word.
92
* @param rank The rank to set
94
public final void setRank(final int rank) {