aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/pages
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-06-30 08:03:38 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-01 09:43:03 +0200
commita16e101fad10d024a84aa36069ec6032fcbaf3e6 (patch)
tree64e19695dccd67c3e1b1621eeac2ad469e01cb46 /core/src/main/kotlin/pages
parent14e71e40dfab5f18ccd56b0c015383c0dfb5df51 (diff)
downloaddokka-a16e101fad10d024a84aa36069ec6032fcbaf3e6.tar.gz
dokka-a16e101fad10d024a84aa36069ec6032fcbaf3e6.tar.bz2
dokka-a16e101fad10d024a84aa36069ec6032fcbaf3e6.zip
Implement `AbstractJavadocTemplateMapTest` API
Diffstat (limited to 'core/src/main/kotlin/pages')
-rw-r--r--core/src/main/kotlin/pages/PageNodes.kt14
1 files changed, 2 insertions, 12 deletions
diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt
index b9f1025f..71ec8597 100644
--- a/core/src/main/kotlin/pages/PageNodes.kt
+++ b/core/src/main/kotlin/pages/PageNodes.kt
@@ -2,11 +2,11 @@ package org.jetbrains.dokka.pages
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.Documentable
+import org.jetbrains.dokka.model.WithChildren
import java.util.*
-interface PageNode {
+interface PageNode: WithChildren<PageNode> {
val name: String
- val children: List<PageNode>
fun modified(
name: String = this.name,
@@ -149,16 +149,6 @@ class MemberPageNode(
else MemberPageNode(name, content, dri, documentable, children, embeddedResources)
}
-fun PageNode.dfs(predicate: (PageNode) -> Boolean): PageNode? = if (predicate(this)) {
- this
-} else {
- this.children.asSequence().mapNotNull { it.dfs(predicate) }.firstOrNull()
-}
-
-fun PageNode.asSequence(): Sequence<PageNode> = sequence {
- yield(this@asSequence)
- children.asSequence().flatMap { it.asSequence() }.forEach { yield(it) }
-}
class MultimoduleRootPageNode(
override val name: String,