Package jetbrains.buildServer.serverSide
Class TreeHierarchyComparator<T>
- java.lang.Object
-
- jetbrains.buildServer.serverSide.TreeHierarchyComparator<T>
-
- Type Parameters:
T- type of nodes in the tree-like hierarchy
- All Implemented Interfaces:
Comparator<T>
- Direct Known Subclasses:
ImportedProjectComparator,ProjectComparator
public abstract class TreeHierarchyComparator<T> extends Object implements Comparator<T>
Abstract comparator that takes into account tree-like hierarchy: - parents must precede children - ordering between nodes on the same depth is defined bycompareOnSameDepth(Object, Object)- Since:
- 9.0
- Author:
- Dmitry.Treskunov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTreeHierarchyComparator.ParentsResolver<T>
-
Constructor Summary
Constructors Constructor Description TreeHierarchyComparator(boolean cacheProjectPaths, TreeHierarchyComparator.ParentsResolver<T> parentsResolver)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompare(T o1, T o2)protected abstract intcompareOnSameDepth(T o1, T o2)booleanisParent(T child, T parent)protected intisRoot(T o1)protected intonSamePath(T left, T right)-
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
TreeHierarchyComparator
public TreeHierarchyComparator(boolean cacheProjectPaths, @NotNull TreeHierarchyComparator.ParentsResolver<T> parentsResolver)
-
-