mirror of
https://github.com/DanilaFe/abacus
synced 2024-07-01 23:06:11 -07:00
15 lines
333 B
Kotlin
15 lines
333 B
Kotlin
|
package org.nwapw.abacus.tree
|
||
|
|
||
|
import org.nwapw.abacus.number.NumberInterface
|
||
|
|
||
|
data class NumberNode(val number: NumberInterface) : TreeNode() {
|
||
|
|
||
|
override fun <T : Any> reduce(reducer: Reducer<T>): T? {
|
||
|
return reducer.reduceNode(this)
|
||
|
}
|
||
|
|
||
|
override fun toString(): String {
|
||
|
return number.toString()
|
||
|
}
|
||
|
|
||
|
}
|