org.jetbrains.kotlinx.jupyter.api.graphs.NodeWrapper.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-jupyter-api Show documentation
Show all versions of kotlin-jupyter-api Show documentation
API for libraries supporting Kotlin Jupyter notebooks
package org.jetbrains.kotlinx.jupyter.api.graphs
import org.jetbrains.kotlinx.jupyter.api.graphs.labels.TextLabel
/**
* Use [NodeWrapper] if [T] cannot implement [GraphNode] itself for some reason
*/
abstract class NodeWrapper(val value: T) : GraphNode {
override val label: Label get() = TextLabel(value.toString())
override val inNodes get() = listOf>()
override val outNodes get() = listOf>()
override val biNodes get() = listOf>()
override fun equals(other: Any?): Boolean {
return other is NodeWrapper<*> && other.value == this.value
}
override fun hashCode(): Int {
return value.hashCode()
}
}