Example #1
0
 /** Process the current Node */
 public final void processNode() {
   Action handler = input.getAction();
   if (handler != null) {
     doAction(handler.getActionCode(), handler);
     // Equivalent to calling handler.action(input, this, output)
   } else {
     // System.err.println("No handler! " + logNode(input.getActive()));
     expandCurrentNode();
     // MUST BE equivalent to the default action for a node.
   }
 }
Example #2
0
 /** Perform any additional action requested by the action routine. */
 protected final void doAction(int flag, Action handler) {
   // debug("   -> " + Action.actionNames[flag+1] + " (" + flag + ")\n");
   switch (flag) {
     case Action.COPY_NODE:
       copyCurrentNode(input.getNode());
       return;
     case Action.ACTIVE_NODE:
       handler.action(input, this, output);
       return;
     case Action.EXPAND_NODE:
       expandCurrentNode();
       return;
     case Action.PUT_NODE:
       putCurrentNode();
       return;
   }
 }