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

// -*-Mode: Java-*- 
// $Id: SameEvent.java,v 1.2 2003/03/06 00:40:43 moltmans Exp $
// SameEvent.java -- 
// Author: Michael Oltmans <moltmans@ai.mit.edu> 
// Created: <Mon May 08 14:01:55 2000> 
// Time-stamp: <2000-05-13 17:32:52 moltmans> 
package rec.annotate.rules;

import rec.annotate.*;
import rec.tms.*;

/**
 **/
public class SameEvent implements Annotation
{
  protected Event m_event1;
  protected Event m_event2;

  public SameEvent( Event event1, Event event2 )
  {
    m_event1 = event1;
    m_event2 = event2;
  }


  public String getFactType() 
  {
    return Type.SAME_EVENT;
  }
  
  
  public boolean sameFact( Fact fact ) 
  {
    if( fact instanceof SameEvent ) {
      SameEvent f = (SameEvent)fact;
      return ( m_event1.sameFact( f.m_event1 ) &&
	       m_event2.sameFact( f.m_event2 ) );
    }
    return false;
  }
  
  public String toString() 
  {
    return "<SameEvent: [" + m_event1 + "] [" + m_event2 + "]>";
  }
}
