Changed package naming across all examples.

This commit is contained in:
Ilkka Seppala
2015-05-31 11:55:18 +03:00
parent 703ebd3e20
commit 8524c75ba6
437 changed files with 1095 additions and 1402 deletions
@@ -0,0 +1,32 @@
package com.iluwatar.nullobject;
/**
*
* Null Object pattern replaces null values with neutral objects.
* Many times this simplifies algorithms since no extra null checks
* are needed.
*
* In this example we build a binary tree where the nodes are either
* normal or Null Objects. No null values are used in the tree making
* the traversal easy.
*
*/
public class App
{
public static void main( String[] args ) {
Node root = new NodeImpl("1",
new NodeImpl("11",
new NodeImpl("111",
NullNode.getInstance(),
NullNode.getInstance()),
NullNode.getInstance()),
new NodeImpl("12",
NullNode.getInstance(),
new NodeImpl("122",
NullNode.getInstance(),
NullNode.getInstance())));
root.walk();
}
}