//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
// PLEASE DO NOT EDIT WITHOUT THE EXPLICIT CONSENT OF THE AUTHOR! \\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

package hlt.language.design.instructions;

/**
 * @version     Last modified on Wed Jun 20 14:29:51 2012 by hak
 * @author      <a href="mailto:hak@acm.org">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; <a href="http://www.hassan-ait-kaci.net/">by the author</a>
 */

import hlt.language.design.backend.Runtime;

public abstract class TupleComponentInstruction extends Instruction
{
  protected int _offset;

  final int offset()
    {
      return _offset;
    }

  public final int hashCode ()
    {
      return name().hashCode() + _offset;
    }

  public final boolean equals (Object object)
    {
      if (this == object)
        return true;

      if (!(object instanceof TupleComponentInstruction))
        return false;

      TupleComponentInstruction other = (TupleComponentInstruction)object;

      return name() == other.name() && _offset == other.offset();
    }

  public final String toString ()
    {
      return name()+"(" + _offset + ")";
    }
}
