View Javadoc

1   /*
2    * $Id: IOASTRunnable.java,v 1.4 2005/07/08 18:16:33 jlerner Exp $
3    *
4    * Copyright (c) 1999-2004, BBN Technologies, LLC.
5    * All rights reserved.
6    * http://www.daml.org/legal/opensource/bbn_license.html
7    */
8    
9   package com.bbn.swede.core.dom;
10  
11  /***
12   * A runnable which executes as a batch operation in an OWL abstract syntax
13   * tree.  Implement this interface to execute code using
14   * <code>IOWLAbstractSyntaxTree.run</code>.
15   * @see com.bbn.swede.core.dom.IOWLAbstractSyntaxTree#run(IOASTRunnable)
16   * @author jlerner
17   */
18  public interface IOASTRunnable
19  {
20     /***
21      * Runs the operation.
22      * @throws OASTException if the runnable attempts to modify a read-only OAST.
23      */
24     void run() throws OASTException;
25     
26     /***
27      * <p>Returns a node to treat as the primary node for the composite event
28      * built by the runnable.  See {@link OASTEvent#getPrimaryNode()} for more 
29      * information on primary nodes.</p>
30      * 
31      * <p>When runnables are nested, only the primary node of the enclosing
32      * runnable is considered.  If the outermost runnable returns no primary
33      * node and an inner runnable does, the resulting event will still have
34      * no primary node.</p>
35      * @return The node to treat as primary for the resulting composite event,
36      *         or <code>null</code> if there is no primary node.
37      * @see DefaultOASTRunnable
38      */
39     OASTNode getPrimaryNode();
40  }