mirror of
https://github.com/AdrianKuta/Tree-Data-Structure.git
synced 2026-06-19 19:00:14 +02:00
feat!: v4.0 breaking API cleanup + explicitApi
BREAKING changes to the core: - treeIterator is now a read-only `val`; added `iterator(order)` and use `asSequence(order)`. - removeChild() only removes a direct child of the receiver; added `detach()` to unhook a node. - addChild() rejects re-parenting and cycles (throws TreeNodeException); detach() first to move. - clear() no longer nulls the receiver's own parent; only removes descendants. - path() returns List<TreeNode<T>>? (null) instead of throwing. Also: - Enable strict explicitApi() across core + both modules; add explicit `public` modifiers. - Update tests for the new contracts + add TreeNodeV4Test; refresh .api baselines. - README + CHANGELOG (with migration notes); bump version to 4.0.0. 47 JVM tests green.
This commit is contained in:
@@ -13,6 +13,7 @@ public class com/github/adriankuta/datastructure/tree/TreeNode : com/github/adri
|
||||
public synthetic fun child (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lcom/github/adriankuta/datastructure/tree/TreeNode;
|
||||
public final fun clear ()V
|
||||
public final fun depth ()I
|
||||
public final fun detach ()Z
|
||||
public final fun getChildren ()Ljava/util/List;
|
||||
public final fun getParent ()Lcom/github/adriankuta/datastructure/tree/TreeNode;
|
||||
public final fun getTreeIterator ()Lcom/github/adriankuta/datastructure/tree/iterators/TreeNodeIterators;
|
||||
@@ -20,11 +21,11 @@ public class com/github/adriankuta/datastructure/tree/TreeNode : com/github/adri
|
||||
public final fun height ()I
|
||||
public final fun isRoot ()Z
|
||||
public fun iterator ()Ljava/util/Iterator;
|
||||
public final fun iterator (Lcom/github/adriankuta/datastructure/tree/iterators/TreeNodeIterators;)Ljava/util/Iterator;
|
||||
public final fun nodeCount ()I
|
||||
public final fun path (Lcom/github/adriankuta/datastructure/tree/TreeNode;)Ljava/util/List;
|
||||
public final fun prettyString ()Ljava/lang/String;
|
||||
public final fun removeChild (Lcom/github/adriankuta/datastructure/tree/TreeNode;)Z
|
||||
public final fun setTreeIterator (Lcom/github/adriankuta/datastructure/tree/iterators/TreeNodeIterators;)V
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user