public final class HierarchyEntityUtils extends Object
HierarchyEntityUtils class.
| Constructor and Description |
|---|
HierarchyEntityUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends HierarchyEntity<T,?>> |
addParent(Collection<T> nodes)
addParent.
|
static <T extends HierarchyEntity<T,?>> |
addParent(Collection<T> nodes,
T toRoot)
addParent.
|
static <T extends HierarchyEntity<T,?>> |
getFamily(T root)
得到给定节点的所有家族结点,包括自身
|
static <T extends HierarchyEntity<T,?>> |
getPath(T node)
Get the path from current node to root.
|
static <T extends HierarchyEntity<T,?>> |
getRoots(List<T> nodes)
getRoots.
|
static <T extends HierarchyEntity<T,?>> |
sort(List<T> datas)
按照上下关系排序
|
static <T extends HierarchyEntity<T,?>> |
sort(List<T> datas,
String property)
按照上下关系和指定属性排序
|
static <T extends HierarchyEntity<T,?>> |
tag(List<T> datas,
String property)
tag.
|
public static <T extends HierarchyEntity<T,?>> Set<T> getFamily(T root)
T - a T object.root - 指定根节点public static <T extends HierarchyEntity<T,?>> Map<T,String> sort(List<T> datas)
public static <T extends HierarchyEntity<T,?>> Map<T,String> sort(List<T> datas, String property)
public static <T extends HierarchyEntity<T,?>> Map<T,String> tag(List<T> datas, String property)
tag.
public static <T extends HierarchyEntity<T,?>> List<T> getRoots(List<T> nodes)
getRoots.
public static <T extends HierarchyEntity<T,?>> List<T> getPath(T node)
Get the path from current node to root. First element is current and last is root.
node - current nodeList object.public static <T extends HierarchyEntity<T,?>> void addParent(Collection<T> nodes)
addParent.
T - a T object.nodes - a Collection object.public static <T extends HierarchyEntity<T,?>> void addParent(Collection<T> nodes, T toRoot)
addParent.
T - a T object.nodes - a Collection object.toRoot - a T object.Copyright © 2005–2018 The Beangle Software. All rights reserved.