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:
java.util.Comparator<T>
- Direct Known Subclasses:
ProjectComparator
public abstract class TreeHierarchyComparator<T> extends java.lang.Object implements java.util.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)
-
-
-
Constructor Detail
-
TreeHierarchyComparator
public TreeHierarchyComparator(boolean cacheProjectPaths, @NotNull TreeHierarchyComparator.ParentsResolver<T> parentsResolver)
-
-
Method Detail
-
isRoot
protected int isRoot(T o1)
-
-