org.eclipse.jdt.ui.text.java
Class AbstractProposalSorter
java.lang.Object
org.eclipse.jdt.ui.text.java.AbstractProposalSorter
-
All Implemented Interfaces:
-
Comparator
-
public abstract class AbstractProposalSorter
- extends
Object
- implements
Comparator
Abstract base class for sorters contributed to the
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.
-
Since:
- 3.2
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
AbstractProposalSorter
protected AbstractProposalSorter()
- Creates a new sorter. Note that subclasses must provide a zero-argument constructor to be
instantiatable via
IConfigurationElement.createExecutableExtension(String)
.
beginSorting
public void beginSorting(
ContentAssistInvocationContext context)
- Called once before sorting.
Clients may override, the default implementation does nothing.
-
-
-
Parameters:
-
context
- the context of the content assist invocation
compare
public abstract int compare(
ICompletionProposal p1,
ICompletionProposal p2)
- Implements the same contract as
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.
-
-
-
Parameters:
-
p1
- the first proposal to be compared -
p2
- the second proposal to be compared
-
Returns:
- a negative integer, zero, or a positive integer as the first argument is less than,
equal to, or greater than the second.
endSorting
public void endSorting()
- Called once after sorting.
Clients may override, the default implementation does nothing.
-
-
compare
public final 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>
.
-
-
Specified by:
-
compare
in interface
Comparator
-
-
See Also:
-
Comparator.compare(java.lang.Object, java.lang.Object)
Copyright (c) IBM Corp. and others 2000, 2008. All Rights Reserved.