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 interface
TreeHierarchyComparator.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 int
compare(T o1, T o2)
protected abstract int
compareOnSameDepth(T o1, T o2)
boolean
isParent(T child, T parent)
protected int
isRoot(T o1)
protected int
onSamePath(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)
-
-