- Type Parameters:
A- тип узла дерева
- All Superinterfaces:
GetTreeParent<A>,ImTree<A>,ImTreeWalk<A>,Tree<A>,TreeNotify<A>
- All Known Subinterfaces:
IndexTree<A>
- All Known Implementing Classes:
MutableTree
public interface UpTree<A extends UpTree<A>> extends Tree<A>, GetTreeParent<A>, TreeNotify<A>
Узел дерева с поддержкой родительского узла
-
Nested Class Summary
Nested classes/interfaces inherited from interface xyz.cofe.collection.ImTreeWalk
ImTreeWalk.Walk<A extends ImTree<? extends A>> -
Method Summary
Modifier and Type Method Description default voidappend(A node)Добавляет дочерний узелdefault voidappends(A... nodes)Добавляет дочерние узлыdefault voidappends(java.lang.Iterable<A> nodes)Добавляет дочерние узлыdefault booleancompareAndSetParent(A parent, A newparent)default voiddelete(A node)Удаляет дочерние узлыdefault voiddeletes(A... nodes)Удаляет дочерние узлыdefault voiddeletes(java.lang.Iterable<A> nodes)Удаляет дочерние узлыdefault AgetNextSibling()Возвращает следующий соседний узелdefault AgetParent()Возвращает родитеский узлер текущего узлаdefault AgetPreviousSibling()Возвращает следующий соседний узелdefault intgetSibIndex()Возвращает индекс узла в списке дочерних узлов по отношению к родителюdefault voidinsert(int idx, A node)Добавляет дочерний узелdefault voidinserts(int idx, A... nodes)Добавляет дочерние узлыdefault voidinserts(int idx, java.lang.Iterable<A> nodes)Добавляет дочерние узлыdefault intlevel()Возвращает вложенность узла начиная от корняdefault java.util.List<A>path()Возвращает путь от корняdefault voidremove(int indexes)Удаляет дочерний узелdefault voidremoves(int... indexes)Удаляет дочерние узлыdefault voidremoves(java.lang.Iterable<java.lang.Integer> indexes)Удаляет дочерние узлыdefault voidset(int idx, A node)Указывает/заменяет узлыdefault voidsetParent(A parent)default voidsets(int idx, A... nodes)Указывает/заменяет узлыdefault voidsets(int idx, java.lang.Iterable<A> nodes)Указывает/заменяет дочерние узлыdefault Asibling(int offset)Переходит соседнему узлуMethods inherited from interface xyz.cofe.collection.TreeNotify
addTreeListener, addTreeListener, getTreeListeners, listen, removeAllTreeListeners, removeTreeListener, treeNotify
-
Method Details
-
getParent
Description copied from interface:GetTreeParentВозвращает родитеский узлер текущего узла- Specified by:
getParentin interfaceGetTreeParent<A extends UpTree<A>>- Returns:
- Родительский узел или null
-
setParent
-
compareAndSetParent
-
append
Description copied from interface:TreeДобавляет дочерний узел -
appends
Description copied from interface:TreeДобавляет дочерние узлы -
appends
Description copied from interface:TreeДобавляет дочерние узлы -
insert
Description copied from interface:TreeДобавляет дочерний узел -
inserts
Description copied from interface:TreeДобавляет дочерние узлы -
inserts
Description copied from interface:TreeДобавляет дочерние узлы -
set
Description copied from interface:TreeУказывает/заменяет узлы -
sets
Description copied from interface:TreeУказывает/заменяет узлы -
sets
Description copied from interface:TreeУказывает/заменяет дочерние узлы -
level
default int level()Возвращает вложенность узла начиная от корня- Returns:
- уровень, 0 - корень
-
path
Возвращает путь от корня- Returns:
- путь
-
remove
default void remove(int indexes)Description copied from interface:TreeУдаляет дочерний узел -
removes
default void removes(int... indexes)Description copied from interface:TreeУдаляет дочерние узлы -
removes
default void removes(java.lang.Iterable<java.lang.Integer> indexes)Description copied from interface:TreeУдаляет дочерние узлы -
delete
Description copied from interface:TreeУдаляет дочерние узлы -
deletes
Description copied from interface:TreeУдаляет дочерние узлы -
deletes
Description copied from interface:TreeУдаляет дочерние узлы -
getSibIndex
default int getSibIndex()Возвращает индекс узла в списке дочерних узлов по отношению к родителю- Returns:
- индекс или -1
-
sibling
Переходит соседнему узлу- Parameters:
offset- смещение от текущего- Returns:
- узел или null
-
getPreviousSibling
Возвращает следующий соседний узел- Returns:
- Узел или null в случаи достижения края
-
getNextSibling
Возвращает следующий соседний узел- Returns:
- Узел или null в случаи достижения края
-