diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2015-09-29 10:03:30 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2015-09-29 10:03:30 -0400 |
| commit | e528aec6d2d277338d7ddfdceba38d62eff08657 (patch) | |
| tree | a5c7c63ed5012e9dc7d93ae1d46fd8493bb37ce8 /BJC-Utils2/src/main/java/bjc/utils/data/bst/DirectedWalkFunction.java | |
| parent | f8215c428f0b46b459c59d0783b4bc4dadfc38a3 (diff) | |
More data structure work.
Yet more imports from previous version.
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/bst/DirectedWalkFunction.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/data/bst/DirectedWalkFunction.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/bst/DirectedWalkFunction.java b/BJC-Utils2/src/main/java/bjc/utils/data/bst/DirectedWalkFunction.java new file mode 100644 index 0000000..232f3d4 --- /dev/null +++ b/BJC-Utils2/src/main/java/bjc/utils/data/bst/DirectedWalkFunction.java @@ -0,0 +1,43 @@ +package bjc.utils.data.bst; + +/** + * Represents a function for doing a directed walk of a binary tree. + * @author ben + * + * @param <T> + */ +@FunctionalInterface +public interface DirectedWalkFunction<T> { + /** + * Represents the results used to direct a walk in a binary tree. + * + * @author ben + * + */ + public enum DirectedWalkResult { + /** + * Specifies that the function has succesfully completed + * + */ + SUCCESS, + /** + * Specifies that the function has failed. + */ + FAILURE, + /** + * Specifies that the function wants to move left in the tree next. + */ + LEFT, + /** + * Specifies that the function wants to move right in the tree next. + */ + RIGHT + } + + /** + * Perform a directed walk on a node of a tree. + * @param data The data stored in the node currently being visited + * @return The way the function wants the walk to go next. + */ + public DirectedWalkResult walk(T data); +} |
