// File: BinaryTreeMaker.java
// An instance of BinaryTreeMaker<E> is able to create instances
// of BinaryTree<E>
// Copyright (C) 2006 Gregory D. Weber

public class BinaryTreeMaker<E> {

    // Cache empty binary tree so we need to create
    // only one for each <E>
    private BinaryTree<E> emptyTree;

    // Public constructor
    public BinaryTreeMaker () { emptyTree = new BinaryTree<E>(); }

    // Tree making methods

    public BinaryTree<E> make () { return emptyTree; }

    public BinaryTree<E> make (E data) { return new BinaryTree<E> (data); }

    public BinaryTree<E> make (E data, BinaryTree<E> left, BinaryTree<E> right)
    {
	return new BinaryTree<E>(data, left, right);
    }

}


    
