com.microsoft.tfs.core.clients.versioncontrol.soapextensions
Class WorkingFolderComparator

java.lang.Object
  extended by com.microsoft.tfs.core.clients.versioncontrol.soapextensions.WorkingFolderComparator
All Implemented Interfaces:
java.util.Comparator<WorkingFolder>

public final class WorkingFolderComparator
extends java.lang.Object
implements java.util.Comparator<WorkingFolder>

Compare engine for WorkingFolder items, to be used with Comparable.compareTo(Object). Supports multiple sort strategies (see WorkingFolderType).

Only server path sorting is implemented, because local path sorting is complicated by cloaked mappings. Cloaks have no local path component, so they cannot be sorted with normal mappings. In theory, the empty local path mappings could be sorted to one side, but a sorted list of these mappings is not currently useful for working folder lookups.

Since:
TEE-SDK-10.1
Thread-safety:
immutable

Constructor Summary
WorkingFolderComparator(WorkingFolderComparatorType sortType)
          Creates a WorkingFolderComparator that compares using the specified strategy.
 
Method Summary
 int compare(WorkingFolder first, WorkingFolder second)
          
 
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

WorkingFolderComparator

public WorkingFolderComparator(WorkingFolderComparatorType sortType)
Creates a WorkingFolderComparator that compares using the specified strategy.

Parameters:
sortType - the type of comparison to perform (must not be null)
Method Detail

compare

public int compare(WorkingFolder first,
                   WorkingFolder second)

Specified by:
compare in interface java.util.Comparator<WorkingFolder>


© 2015 Microsoft. All rights reserved.