| 程序包 | 说明 |
|---|---|
| com.centit.support.algorithm |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T,U> CollectionsOpt.ParentChild<? super T> |
CollectionsOpt.mapParentANdChild(Function<? super T,? extends U> pkExtractor,
Function<? super T,? extends U> parentPkExtractor) |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> TreeNode<T> |
CollectionsOpt.fetchTreeBranch(List<T> list,
Predicate<T> startKey,
CollectionsOpt.ParentChild<? super T> c,
int levels) |
static <T> List<Integer> |
CollectionsOpt.makeJqueryTreeIndex(List<T> list,
CollectionsOpt.ParentChild<? super T> c)
对排序好的树形数组结构 找到JQueryTree要的Indexes
|
static <T> void |
CollectionsOpt.sortAsTree(List<T> list,
CollectionsOpt.ParentChild<? super T> c)
将数组结构按照树形展示的形式进行排序,将所有孩子元素放到父元素的下面
深度优先的排序
|
static <T> com.alibaba.fastjson2.JSONArray |
CollectionsOpt.sortAsTreeAndToJSON(List<T> treeList,
CollectionsOpt.ParentChild<? super T> c,
String childrenPropertyName)
将列表转换为tree结构的json
|
static <T> com.alibaba.fastjson2.JSONArray |
CollectionsOpt.sortAsTreeAndToJSON2(List<T> treeList,
CollectionsOpt.ParentChild<? super T> c,
String childrenPropertyName)
将列表转换为tree结构的json
和 sortAsTreeAndToJSON2 用不同的算法实现,这个需要额外的空间,用递归实现。
|
static <T> List<TreeNode<T>> |
CollectionsOpt.storedAsTree(List<T> list,
CollectionsOpt.ParentChild<? super T> c)
将数组结构按照树形展示的形式进行排序,将所有孩子元素放到父元素的下面
深度优先的排序
|
static <T> com.alibaba.fastjson2.JSONArray |
CollectionsOpt.treeToJSONArray(List<T> treeList,
CollectionsOpt.ParentChild<? super T> c,
String childrenPropertyName)
将TreeList转换为JSONArray
|
Copyright © 2025 江苏南大先腾信息产业股份有限公司. All rights reserved.