/*
 * NameSetTypeImpl.java
 *
 * Created on 18 de Julho de 2005, 13:58
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package net.sourceforge.czt.typecheck.circus.impl;

import net.sourceforge.czt.circustools.ast.*;
import net.sourceforge.czt.circustools.impl.*;
import net.sourceforge.czt.circustools.visitor.*;
import net.sourceforge.czt.typecheck.z.impl.*;
import net.sourceforge.czt.z.ast.Signature;

/**
 *
 * @author Manuela
 */
public class NameSetTypeImpl
  extends Type2Impl
  implements NameSetType
{
  
  /** Creates a new instance of NameSetTypeImpl */
  public NameSetTypeImpl(NameSetType nameSetType)
  {
    super(nameSetType);
  }
  
  public Signature getNames() 
  {
    NameSetType nameSetType = (NameSetType) term_;
    Signature result = nameSetType.getNames();
    return result;
  }

  public void setNames(Signature names)
  {
    NameSetType nameSetType = (NameSetType) term_;
    nameSetType.setNames(names);
  }

  public boolean equals(Object obj)
  {
    if (obj instanceof NameSetType) {
      NameSetType nameSetType = (NameSetType) obj;
      return getNames().equals(nameSetType.getNames());
    }
    return false;
  }

  public int hashCode()
  {
    final int constant = 31;

    int hashCode = super.hashCode();
    hashCode += "NameSetTypeImpl".hashCode();
    if (getNames() != null) {
      //hashCode += constant * getActionSignature().hashCode();
    }
    return hashCode;
  }

  /**
   * Accepts a visitor.
   */
  public Object accept(net.sourceforge.czt.util.Visitor v)
  {
    if (v instanceof NameSetTypeVisitor) {
      NameSetTypeVisitor visitor = (NameSetTypeVisitor) v;
      return visitor.visitNameSetType(this);
    }
    return super.accept(v);
  }
  
  public net.sourceforge.czt.base.ast.Term create(Object [] args)
  {
    NameSetType nameSetType = (NameSetType) term_.create(args);
    NameSetType result = new NameSetTypeImpl(nameSetType);
    return result;
  }
  
}
