Class BaseNodeIdx<ID,C extends BaseNodeIdx<ID,C>>
java.lang.Object
com.power4j.fist.data.tree.domain.BaseNodeIdx<ID,C>
- All Implemented Interfaces:
NodeIdx<ID,C>
public abstract class BaseNodeIdx<ID,C extends BaseNodeIdx<ID,C>>
extends Object
implements NodeIdx<ID,C>
需要存储树形结构信息时可以继承此类
- Since:
- 1.0
- Author:
- CJ (power4j@outlook.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription祖先节点后代节点int层距离,指向自己时距离为0voidsetAncestor(ID ancestor) voidsetDescendant(ID descendant) voidsetDistance(int distance) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.power4j.fist.data.tree.domain.NodeIdx
immediate, isNode, isNodeOrImmediate
-
Constructor Details
-
BaseNodeIdx
public BaseNodeIdx() -
BaseNodeIdx
-
-
Method Details
-
setAncestor
-
setDescendant
-
setDistance
public void setDistance(int distance) -
getAncestor
Description copied from interface:NodeIdx祖先节点- Specified by:
getAncestorin interfaceNodeIdx<ID,C extends BaseNodeIdx<ID, C>> - Returns:
- 祖先节点ID
-
getDescendant
Description copied from interface:NodeIdx后代节点- Specified by:
getDescendantin interfaceNodeIdx<ID,C extends BaseNodeIdx<ID, C>> - Returns:
- 后代节点ID
-
getDistance
public int getDistance()Description copied from interface:NodeIdx层距离,指向自己时距离为0- Specified by:
getDistancein interfaceNodeIdx<ID,C extends BaseNodeIdx<ID, C>> - Returns:
- 层距离
-
toString
-