Remove data modifier from tree classes.

This commit is contained in:
Danila Fedorin 2017-08-25 01:07:59 -07:00
parent ac19c7b230
commit c5cd0f81ad
5 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ package org.nwapw.abacus.tree
* @param left the left node.
* @param right the right node.
*/
data class BinaryNode(val operation: String, val left: TreeNode? = null, val right: TreeNode?) : TreeNode() {
class BinaryNode(val operation: String, val left: TreeNode? = null, val right: TreeNode?) : TreeNode() {
override fun <T : Any> reduce(reducer: Reducer<T>): T? {
val leftReduce = left?.reduce(reducer) ?: return null

View File

@ -8,7 +8,7 @@ package org.nwapw.abacus.tree
*
* @param function the function string.
*/
data class FunctionNode(val function: String) : TreeNode() {
class FunctionNode(val function: String) : TreeNode() {
/**
* List of function parameters added to this node.

View File

@ -10,7 +10,7 @@ import org.nwapw.abacus.number.NumberInterface
*
* @number the number value of this node.
*/
data class NumberNode(val number: String) : TreeNode() {
class NumberNode(val number: String) : TreeNode() {
override fun <T : Any> reduce(reducer: Reducer<T>): T? {
return reducer.reduceNode(this)

View File

@ -9,7 +9,7 @@ package org.nwapw.abacus.tree
* @param operation the operation applied to the given node.
* @param applyTo the node to which the operation will be applied.
*/
data class UnaryNode(val operation: String, val applyTo: TreeNode? = null) : TreeNode() {
class UnaryNode(val operation: String, val applyTo: TreeNode? = null) : TreeNode() {
override fun <T : Any> reduce(reducer: Reducer<T>): T? {
val reducedChild = applyTo?.reduce(reducer) ?: return null

View File

@ -8,7 +8,7 @@ package org.nwapw.abacus.tree
*
* @param variable the actual variable name that this node represents.
*/
data class VariableNode(val variable: String) : TreeNode() {
class VariableNode(val variable: String) : TreeNode() {
override fun <T : Any> reduce(reducer: Reducer<T>): T? {
return reducer.reduceNode(this)