This commit is contained in:
Looly 2020-03-20 11:03:20 +08:00
parent 77aee971a5
commit 8c734607a1
3 changed files with 8 additions and 2 deletions

View File

@ -7,7 +7,7 @@ package cn.hutool.core.lang.tree;
* @author looly
* @since 5.2.4
*/
public interface Node<T> extends Comparable<Node<T>>{
public interface Node<T> extends Comparable<Node<T>> {
/**
* 获取ID
*
@ -19,6 +19,7 @@ public interface Node<T> extends Comparable<Node<T>>{
* 设置ID
*
* @param id ID
* @return this
*/
Node<T> setId(T id);
@ -33,7 +34,7 @@ public interface Node<T> extends Comparable<Node<T>>{
* 设置父节点ID
*
* @param parentId 父节点ID
* @return 父节点ID
* @return this
*/
Node<T> setParentId(T parentId);
@ -68,6 +69,7 @@ public interface Node<T> extends Comparable<Node<T>>{
Node<T> setWeight(Comparable<?> weight);
@SuppressWarnings({"unchecked", "rawtypes", "NullableProblems"})
@Override
default int compareTo(Node node) {
final Comparable weight = this.getWeight();
if (null != weight) {

View File

@ -123,6 +123,8 @@ public class TreeUtil {
* 获取ID对应的节点如果有多个ID相同的节点只返回第一个<br>
* 此方法只查找此节点及子节点采用广度优先遍历
*
* @param <T> ID类型
* @param node 节点
* @param id ID
* @return 节点
* @since 5.2.4

View File

@ -1060,6 +1060,7 @@ public class ClassUtil {
* class在jar包中返回jar所在文件夹,class不在jar中返回文件夹目录<br>
* jdk中的类不能使用此方法
*
* @param clazz
* @return URL
* @since 5.2.4
*/
@ -1075,6 +1076,7 @@ public class ClassUtil {
* class在jar包中返回jar所在文件夹,class不在jar中返回文件夹目录<br>
* jdk中的类不能使用此方法
*
* @param clazz
* @return class路径
* @since 5.2.4
*/