diff options
| author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-06-30 08:03:38 +0200 |
|---|---|---|
| committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-07-01 09:43:03 +0200 |
| commit | a16e101fad10d024a84aa36069ec6032fcbaf3e6 (patch) | |
| tree | 64e19695dccd67c3e1b1621eeac2ad469e01cb46 /core/src/main/kotlin/pages | |
| parent | 14e71e40dfab5f18ccd56b0c015383c0dfb5df51 (diff) | |
| download | dokka-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.kt | 14 |
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, |
