// (c) MIT 2003.  All rights reserved.

// -*-Mode: Java-*- 
// $Id: AnnotateRule.java,v 1.5 2003/03/06 00:40:49 moltmans Exp $
// AnnotateRule.java -- 
// Author: Michael Oltmans <moltmans@ai.mit.edu> 
// Created: <Tue May 09 18:29:05 2000> 
// Time-stamp: <2000-06-09 18:49:48 moltmans> 
package rec.annotate.rules;

import rec.annotate.facts.*;
import java.util.*;
import rec.tms.*;
import rec.sys.*;

/**
 * This is 
 **/
public abstract class AnnotateRule implements Rule 
{
  protected Surface m_surface;
  protected Notebook m_notebook;

  public AnnotateRule() {
  }
  
  public void setSurface( Surface s )
  {
    m_surface = s;
    m_notebook = s.getNotebook();
  }

  public Notebook getNotebook() 
  {
    return m_notebook;
  }

  public Surface getSurface() 
  {
    return m_surface;
  }
  
  /**
   * @param bindings List of bindings to run the body with
   * @return true if the body actually fires on the given datum.
   **/
  public abstract void run( Surface s, Notebook book,
			    LinkedList bindings );

  /**
   * This is final since we don't want subclasses to accidentally
   * redefine it.
   **/
  public final void run( JTRE jtre, LinkedList bindings ) 
  {
    run( m_surface, m_notebook, bindings );
  }
}

