Remote Systems
v6.4.1

com.ibm.etools.systems.launch.sourceLookup
Class DefaultSourceLookupSorter

java.lang.Object
  extended bycom.ibm.etools.systems.launch.sourceLookup.DefaultSourceLookupSorter
All Implemented Interfaces:
IRemoteSourceLookupSorter

public class DefaultSourceLookupSorter
extends Object
implements IRemoteSourceLookupSorter

Implements default sorting for source lookup result. The sorting is based on the degree of relevant. A weight value string will be caculated for each search result. Then the results will be sorted by the weight value. The weight value string is caculated as three parts {match, folder level, variation}: match + folder hierchy level related to the source lookup path + variation match is defined as two chars string: 10 -- exact match of file name to be searched 11 -- partial match of file name folder level as two chars string: 10 -- top level of source lookup path 11 -- direct subfolder 12 -- second level of subfolder ... etc variation defined as the file seqence returned from original search result. this value is used in order to avoid the conflication of map key ( for example, a conflication case is : same match level and same folder level )


Field Summary
protected static String ALL_MATCH
           
protected static String FILLER_LEVEL
           
protected static String FILLER_MATCH
           
protected static String PART_MATCH
           
protected static String TOP_LEVEL
           
 
Constructor Summary
DefaultSourceLookupSorter()
           
 
Method Summary
 Object[] sort(Object[] results, IPath searchPath, String fileNameSearched)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_MATCH

protected static String ALL_MATCH

PART_MATCH

protected static String PART_MATCH

FILLER_MATCH

protected static String FILLER_MATCH

TOP_LEVEL

protected static String TOP_LEVEL

FILLER_LEVEL

protected static String FILLER_LEVEL
Constructor Detail

DefaultSourceLookupSorter

public DefaultSourceLookupSorter()
Method Detail

sort

public Object[] sort(Object[] results,
                     IPath searchPath,
                     String fileNameSearched)
Specified by:
sort in interface IRemoteSourceLookupSorter
Parameters:
results - : the remote search results
Returns:
sorted result

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.