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

// $Id: Mark.java,v 1.4 2003/03/06 00:40:40 moltmans Exp $
// Time-stamp: <2000-03-11 18:59:37 moltmans>
package rec.sys;


///////////////////////////////////////////////////////////////////////////////
//
// FILE:	Mark.java
//
// COPYRIGHT:	Massachusetts Institute of Technology
//		All rights reserved.
//
// PURPOSE:	Drawing recognition system
//
///////////////////////////////////////////////////////////////////////////////


import java.util.*;
//import java.io.*;

import rec.util.*;


/**
 * This is used to mark 'frames' in the TransitionRecorder,
 * namely points between transitions--static images of the surface.
 */
public class Mark {// implements Serializable {

  private String name;
  private Id id;

  public Mark( String name ) 
  {
    id = new Id();
    this.name = name.toString();
  }

  public String name()
  {
    return name;
  }

  public int hashCode( )
  {
    return id.hashCode();
  }

  public String toString( )
  {
    return "mark:" + id + "/" + name;
  }

  public boolean equals( Object o )
  {
    if ( o instanceof Mark )
      return id.equals( ((Mark)o).id );
    else
      // this BRUTAL LITTLE HACK is so the MarkSet can get a shot at
      // computing whether it contains the mark through the equals 
      // method so the searches in the stack object work out okay.
      // YUCK! -lw
      return o.equals( this );
  }

}
