summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java
diff options
context:
space:
mode:
authorbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:45:04 -0500
committerbjculkin <bjculkin@mix.wvu.edu>2018-02-12 22:45:04 -0500
commitdf94066e3af02ff02d5ab4d033a3d603f743234c (patch)
tree168a1edaf58d386c175ffb601e9d4da8e13d31e2 /base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java
parentae51c587c53f7ca311e556e3cbd0c5566d6c2843 (diff)
Formatting pass
Diffstat (limited to 'base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java')
-rw-r--r--base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java b/base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java
index 46f597e..762288f 100644
--- a/base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java
+++ b/base/src/main/java/bjc/utils/funcdata/bst/BinarySearchTreeLeaf.java
@@ -11,7 +11,7 @@ import java.util.function.Predicate;
* @author ben
*
* @param <T>
- * The data stored in the tree.
+ * The data stored in the tree.
*/
public class BinarySearchTreeLeaf<T> implements ITreePart<T> {
/** The data held in this tree leaf */
@@ -24,7 +24,7 @@ public class BinarySearchTreeLeaf<T> implements ITreePart<T> {
* Create a new leaf holding the specified data.
*
* @param element
- * The data for the leaf to hold.
+ * The data for the leaf to hold.
*/
public BinarySearchTreeLeaf(final T element) {
data = element;
@@ -37,7 +37,7 @@ public class BinarySearchTreeLeaf<T> implements ITreePart<T> {
@Override
public <E> E collapse(final Function<T, E> leafTransformer, final BiFunction<E, E, E> branchCollapser) {
- if (leafTransformer == null) throw new NullPointerException("Transformer must not be null");
+ if(leafTransformer == null) throw new NullPointerException("Transformer must not be null");
return leafTransformer.apply(data);
}
@@ -54,16 +54,16 @@ public class BinarySearchTreeLeaf<T> implements ITreePart<T> {
@Override
public void delete(final T element, final Comparator<T> comparator) {
- if (data.equals(element)) {
+ if(data.equals(element)) {
isDeleted = true;
}
}
@Override
public boolean directedWalk(final DirectedWalkFunction<T> treeWalker) {
- if (treeWalker == null) throw new NullPointerException("Tree walker must not be null");
+ if(treeWalker == null) throw new NullPointerException("Tree walker must not be null");
- switch (treeWalker.walk(data)) {
+ switch(treeWalker.walk(data)) {
case SUCCESS:
return true;
/* We don't have any children to care about. */
@@ -78,7 +78,7 @@ public class BinarySearchTreeLeaf<T> implements ITreePart<T> {
@Override
public boolean forEach(final TreeLinearizationMethod linearizationMethod,
final Predicate<T> traversalPredicate) {
- if (traversalPredicate == null) throw new NullPointerException("Predicate must not be null");
+ if(traversalPredicate == null) throw new NullPointerException("Predicate must not be null");
return traversalPredicate.test(data);
}
@@ -99,16 +99,16 @@ public class BinarySearchTreeLeaf<T> implements ITreePart<T> {
@Override
public boolean equals(final Object obj) {
- if (this == obj) return true;
- if (obj == null) return false;
- if (!(obj instanceof BinarySearchTreeLeaf<?>)) return false;
+ if(this == obj) return true;
+ if(obj == null) return false;
+ if(!(obj instanceof BinarySearchTreeLeaf<?>)) return false;
final BinarySearchTreeLeaf<?> other = (BinarySearchTreeLeaf<?>) obj;
- if (data == null) {
- if (other.data != null) return false;
- } else if (!data.equals(other.data)) return false;
- if (isDeleted != other.isDeleted) return false;
+ if(data == null) {
+ if(other.data != null) return false;
+ } else if(!data.equals(other.data)) return false;
+ if(isDeleted != other.isDeleted) return false;
return true;
}