
/**
 * EmptyTree.java
 *
 *
 * Created: Sun Oct 20 22:38:53 2002
 *
 * @author <a href="mailto: "</a>
 * @version
 */

public class EmptyTree extends AState{
   private static AState onlyOne = new EmptyTree();
   
   private EmptyTree() { }  // none outside can access this
   
   public static EmptyTree singleton(){
	    return (EmptyTree)onlyOne;
     }
   
   public Object getData( )   
   {
      return null;
   }

   public SBTree getLeft( )
   {
      return null;                                              
   } 
   
   public SBTree getRight( )
   {
      return null;                                               
   } 


   public void setData(Object obj, SBTree sbt)   
   {
      sbt.changeState(new NonEmptyTree(obj));
   }                                                               
   

   public void setLeft(SBTree lft)
   {                    
      //may throw an exception
   }

   public void setRight(SBTree rgt)
   {                    
      // may throw an exception
   }  


   public Object acceptVisitor(SBVisitor outsider, Object inp, SBTree sbt)
   {  
      // callback visitor
      return outsider.operationOnEmpty(sbt, inp);
   }
   
}// EmptyTree
