1
0
mirror of https://github.com/DanilaFe/abacus synced 2025-12-15 13:48:57 -08:00
Abacus/src/main/java/org/nwapw/abacus/tree/TreeNode.java

18 lines
448 B
Java
Raw Normal View History

2017-07-25 13:53:38 -07:00
package org.nwapw.abacus.tree;
2017-07-26 10:10:37 -07:00
/**
* An abstract class that represents an expression tree node.
*/
2017-07-25 13:53:38 -07:00
public abstract class TreeNode {
/**
* The function that reduces a tree to a single vale.
2017-07-30 21:11:32 -07:00
*
* @param reducer the reducer used to reduce the tree.
2017-07-30 21:11:32 -07:00
* @param <T> the type the reducer produces.
* @return the result of the reduction, or null on error.
*/
public abstract <T> T reduce(Reducer<T> reducer);
2017-07-25 13:53:38 -07:00
}