commonMain.it.unibo.tuprolog.bdd.impl.builder.SimpleBinaryDecisionDiagramVariable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bdd-jvm Show documentation
Show all versions of bdd-jvm Show documentation
Multi-platform library for representing and manipulating Binary Decision Diagrams
package it.unibo.tuprolog.bdd.impl.builder
import it.unibo.tuprolog.bdd.BinaryDecisionDiagram
/**
* @author Jason Dellaluce
*/
internal data class SimpleBinaryDecisionDiagramVariable>(
override val value: T,
override val low: BinaryDecisionDiagram,
override val high: BinaryDecisionDiagram
) : BinaryDecisionDiagram.Variable {
private val hashCodeCache: Int by lazy {
var result = value.hashCode()
result = 31 * result + low.hashCode()
result = 31 * result + high.hashCode()
result
}
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as SimpleBinaryDecisionDiagramVariable<*>
if (value != other.value) return false
if (low != other.low) return false
if (high != other.high) return false
return true
}
override fun hashCode(): Int {
return hashCodeCache
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy