/*
 * ChanSetTypeImpl.java
 *
 * Created on 18 de Julho de 2005, 13:49
 *
 * 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 ChanSetTypeImpl
  extends Type2Impl
  implements ChanSetType
{
  
  /** Creates a new instance of ChanSetTypeImpl */
  protected ChanSetTypeImpl(ChanSetType chanSetType)
  {
    super(chanSetType);
  }
  
  public Signature getChannels() 
  {
    ChanSetType chanSetType = (ChanSetType) term_;
    Signature result = chanSetType.getChannels();
    return result;
  }

  public void setChannels(Signature channels)
  {
    ChanSetType chanSetType = (ChanSetType) term_;
    chanSetType.setChannels(channels);
  }

  public boolean equals(Object obj)
  {
    if (obj instanceof ChanSetType) {
      ChanSetType chanSetType = (ChanSetType) obj;
      return getChannels().equals(chanSetType.getChannels());
    }
    return false;
  }

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

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

  /**
   * Accepts a visitor.
   */
  public Object accept(net.sourceforge.czt.util.Visitor v)
  {
    if (v instanceof ChanSetTypeVisitor) {
      ChanSetTypeVisitor visitor = (ChanSetTypeVisitor) v;
      return visitor.visitChanSetType(this);
    }
    return super.accept(v);
  }
  
  public net.sourceforge.czt.base.ast.Term create(Object [] args)
  {
    ChanSetType chanSetType = (ChanSetType) term_.create(args);
    ChanSetType result = new ChanSetTypeImpl(chanSetType);
    return result;
  }
  
}
