All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.jupyter.api.graphs.NodeWrapper.kt Maven / Gradle / Ivy

There is a newer version: 0.12.0-335
Show newest version
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()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy