File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
main/java/com/iluwatar/nullobject
test/java/com/iluwatar/nullobject Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 5
5
* Null Object pattern replaces null values with neutral objects.
6
6
* Many times this simplifies algorithms since no extra null checks
7
7
* are needed.
8
- *
8
+ * <p>
9
9
* In this example we build a binary tree where the nodes are either
10
10
* normal or Null Objects. No null values are used in the tree making
11
11
* the traversal easy.
12
12
*
13
13
*/
14
14
public class App
15
15
{
16
+ /**
17
+ * Program entry point
18
+ * @param args command line args
19
+ */
16
20
public static void main ( String [] args ) {
17
21
18
22
Node root = new NodeImpl ("1" ,
Original file line number Diff line number Diff line change 3
3
/**
4
4
*
5
5
* Null Object implementation for binary tree node.
6
- *
6
+ * <p>
7
7
* Implemented as Singleton, since all the NullNodes are the same.
8
8
*
9
9
*/
Original file line number Diff line number Diff line change 4
4
5
5
import com .iluwatar .nullobject .App ;
6
6
7
+ /**
8
+ *
9
+ * Application test
10
+ *
11
+ */
7
12
public class AppTest {
8
13
9
14
@ Test
You can’t perform that action at this time.
0 commit comments