package jetbrains.mps.lang.smodel.typesystem;

/*Generated by MPS */

import jetbrains.mps.lang.typesystem.runtime.ComparisonRule_Runtime;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.lang.typesystem.runtime.IsApplicable2Status;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.lang.typesystem.runtime.IsApplicableStatus;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import org.jetbrains.mps.openapi.language.SReferenceLink;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.language.SConcept;

public class interface_node_types_are_comparable_ComparisonRule extends ComparisonRule_Runtime {
  public interface_node_types_are_comparable_ComparisonRule() {
  }
  public boolean areComparable(SNode node1, SNode node2, IsApplicable2Status status) {
    if (SNodeOperations.isInstanceOf(SLinkOperations.getTarget(node1, LINKS.concept$OMgE), CONCEPTS.InterfaceConceptDeclaration$CG) || SNodeOperations.isInstanceOf(SLinkOperations.getTarget(node2, LINKS.concept$OMgE), CONCEPTS.InterfaceConceptDeclaration$CG)) {
      return true;
    }
    return false;
  }
  public boolean isWeak() {
    return true;
  }
  public IsApplicableStatus isApplicableFirst(SNode node) {
    return new IsApplicableStatus(node.getConcept().isSubConceptOf(getApplicableConcept1()), null);
  }
  public IsApplicableStatus isApplicableSecond(SNode node) {
    return new IsApplicableStatus(node.getConcept().isSubConceptOf(getApplicableConcept2()), null);
  }

  public SAbstractConcept getApplicableConcept1() {
    return CONCEPTS.SNodeType$hR;
  }
  public SAbstractConcept getApplicableConcept2() {
    return CONCEPTS.SNodeType$hR;
  }

  private static final class LINKS {
    /*package*/ static final SReferenceLink concept$OMgE = MetaAdapterFactory.getReferenceLink(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, 0x1090e46ca51L, "concept");
  }

  private static final class CONCEPTS {
    /*package*/ static final SConcept InterfaceConceptDeclaration$CG = MetaAdapterFactory.getConcept(0xc72da2b97cce4447L, 0x8389f407dc1158b7L, 0x1103556dcafL, "jetbrains.mps.lang.structure.structure.InterfaceConceptDeclaration");
    /*package*/ static final SConcept SNodeType$hR = MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType");
  }
}
