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

// $Id: Describes.java,v 1.3 2003/03/06 00:40:49 moltmans Exp $
// Describes.java -- 
// Author: Michael Oltmans <moltmans@ai.mit.edu> 
// Created: <Sun Jul 16 19:40:09 2000> 
// Time-stamp: <2000-07-19 17:06:02 moltmans> 
package rec.annotate.facts;

import rec.annotate.rules.*;
import java.util.*;
import rec.annotate.widgets.*;
import rec.util.*;
import rec.sys.*;
import rec.tms.*;

/**
 * This records the fact that one annotation describes another
 * annotation.  The first one will be a gesture or a sentence
 **/
public class Describes extends Annotation
{
  protected Annotation m_base;
  protected Annotation m_annotation;

  public Describes( Annotation base, Annotation annotation )
  {
    super( base.getStartTime(), base.getEndTime() );
    m_base = base;
    m_annotation = annotation;
  }
  
  public Annotation getBase()
  {
    return m_base;
  }

  public Annotation getAnnotation()
  {
    return m_annotation;
  }

  public String getFactType() 
  {
    return Type.DESCRIBES;
  }

  public boolean sameFact( Fact fact ) 
  {
    if( fact instanceof Describes ) {
      Describes f = (Describes)fact;
      return ( m_base.sameFact( f.m_base ) &&
	       m_annotation.sameFact( f.m_annotation ) );
    }
    return false;
  }

  public String toString() 
  {
    return( "<Describes: [" + m_base +
	    "] [" + m_annotation + "]>" );
  }

  public String toEnglish()
  {
    return ( m_base + 
	     " describes " +
	     m_annotation );
  }
  
}
