Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse JDT
Release 3.5

org.eclipse.jdt.ui.text.java
Class AbstractProposalSorter


java.lang.Object
  extended by 
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

Constructor Summary
protected AbstractProposalSorter ()
          Creates a new sorter.
 
Method Summary
 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.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util. Comparator
equals
 

Constructor Detail

AbstractProposalSorter

protected AbstractProposalSorter()
Creates a new sorter. Note that subclasses must provide a zero-argument constructor to be instantiatable via IConfigurationElement.createExecutableExtension(String).

Method Detail

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)

Eclipse JDT
Release 3.5

Copyright (c) IBM Corp. and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire