All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hydra.langs.java.syntax.StatementNoShortIf Maven / Gradle / Ivy

package hydra.langs.java.syntax;

import java.io.Serializable;

public abstract class StatementNoShortIf implements Serializable {
  public static final hydra.core.Name NAME = new hydra.core.Name("hydra/langs/java/syntax.StatementNoShortIf");
  
  private StatementNoShortIf () {
  
  }
  
  public abstract  R accept(Visitor visitor) ;
  
  public interface Visitor {
    R visit(WithoutTrailing instance) ;
    
    R visit(Labeled instance) ;
    
    R visit(IfThenElse instance) ;
    
    R visit(While instance) ;
    
    R visit(For instance) ;
  }
  
  public interface PartialVisitor extends Visitor {
    default R otherwise(StatementNoShortIf instance) {
      throw new IllegalStateException("Non-exhaustive patterns when matching: " + (instance));
    }
    
    default R visit(WithoutTrailing instance) {
      return otherwise((instance));
    }
    
    default R visit(Labeled instance) {
      return otherwise((instance));
    }
    
    default R visit(IfThenElse instance) {
      return otherwise((instance));
    }
    
    default R visit(While instance) {
      return otherwise((instance));
    }
    
    default R visit(For instance) {
      return otherwise((instance));
    }
  }
  
  public static final class WithoutTrailing extends hydra.langs.java.syntax.StatementNoShortIf implements Serializable {
    public final hydra.langs.java.syntax.StatementWithoutTrailingSubstatement value;
    
    public WithoutTrailing (hydra.langs.java.syntax.StatementWithoutTrailingSubstatement value) {
      this.value = value;
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof WithoutTrailing)) {
        return false;
      }
      WithoutTrailing o = (WithoutTrailing) (other);
      return value.equals(o.value);
    }
    
    @Override
    public int hashCode() {
      return 2 * value.hashCode();
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
  
  public static final class Labeled extends hydra.langs.java.syntax.StatementNoShortIf implements Serializable {
    public final hydra.langs.java.syntax.LabeledStatementNoShortIf value;
    
    public Labeled (hydra.langs.java.syntax.LabeledStatementNoShortIf value) {
      this.value = value;
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof Labeled)) {
        return false;
      }
      Labeled o = (Labeled) (other);
      return value.equals(o.value);
    }
    
    @Override
    public int hashCode() {
      return 2 * value.hashCode();
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
  
  public static final class IfThenElse extends hydra.langs.java.syntax.StatementNoShortIf implements Serializable {
    public final hydra.langs.java.syntax.IfThenElseStatementNoShortIf value;
    
    public IfThenElse (hydra.langs.java.syntax.IfThenElseStatementNoShortIf value) {
      this.value = value;
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof IfThenElse)) {
        return false;
      }
      IfThenElse o = (IfThenElse) (other);
      return value.equals(o.value);
    }
    
    @Override
    public int hashCode() {
      return 2 * value.hashCode();
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
  
  public static final class While extends hydra.langs.java.syntax.StatementNoShortIf implements Serializable {
    public final hydra.langs.java.syntax.WhileStatementNoShortIf value;
    
    public While (hydra.langs.java.syntax.WhileStatementNoShortIf value) {
      this.value = value;
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof While)) {
        return false;
      }
      While o = (While) (other);
      return value.equals(o.value);
    }
    
    @Override
    public int hashCode() {
      return 2 * value.hashCode();
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
  
  public static final class For extends hydra.langs.java.syntax.StatementNoShortIf implements Serializable {
    public final hydra.langs.java.syntax.ForStatementNoShortIf value;
    
    public For (hydra.langs.java.syntax.ForStatementNoShortIf value) {
      this.value = value;
    }
    
    @Override
    public boolean equals(Object other) {
      if (!(other instanceof For)) {
        return false;
      }
      For o = (For) (other);
      return value.equals(o.value);
    }
    
    @Override
    public int hashCode() {
      return 2 * value.hashCode();
    }
    
    @Override
    public  R accept(Visitor visitor) {
      return visitor.visit(this);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy