public abstract class AbstractProposalSorter extends Object implements Comparator
org.eclipse.jdt.ui.javaCompletionProposalSorters
extension point.
Subclasses need to implement compare(ICompletionProposal, ICompletionProposal)
and may
override beginSorting
and
endSorting
.
The orderings imposed by a subclass need not be consistent with equals.
Modifier | Constructor and Description |
---|---|
protected |
AbstractProposalSorter()
Creates a new sorter.
|
Modifier and Type | Method and Description |
---|---|
void |
beginSorting(ContentAssistInvocationContext context)
Called once before sorting.
|
abstract int |
compare(ICompletionProposal p1,
ICompletionProposal p2)
Implements the same contract as
Comparator.compare(Object, Object) but with
completion proposals as parameters. |
int |
compare(Object o1,
Object o2)
This method delegates to
compare(ICompletionProposal, ICompletionProposal) and may
be removed if the class is ever converted to extend
Comparator<ICompletionProposal> . |
void |
endSorting()
Called once after sorting.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
protected AbstractProposalSorter()
IConfigurationElement.createExecutableExtension(String)
.public void beginSorting(ContentAssistInvocationContext context)
Clients may override, the default implementation does nothing.
context
- the context of the content assist invocationpublic abstract int compare(ICompletionProposal p1, ICompletionProposal p2)
Comparator.compare(Object, Object)
but with
completion proposals as parameters. This method will implement the Comparator
interface if this class is ever converted to extend
Comparator<ICompletionProposal>
.
The orderings imposed by an implementation need not be consistent with equals.
p1
- the first proposal to be comparedp2
- the second proposal to be comparedpublic void endSorting()
Clients may override, the default implementation does nothing.
public final int compare(Object o1, Object o2)
compare(ICompletionProposal, ICompletionProposal)
and may
be removed if the class is ever converted to extend
Comparator<ICompletionProposal>
.compare
in interface Comparator
Comparator.compare(java.lang.Object, java.lang.Object)
Copyright (c) IBM Corp. and others 2000, 2006. All Rights Reserved.