Class CClass.SClassDecl

  • Enclosing class:
    CClass

    public static final class CClass.SClassDecl
    extends Object
    Represents the declaration of an SClass within this CClass. This comprises optional access modifiers, the class, the name and also optionally, a probability distribution distr or a formula declaration form.
    • Field Detail

      • isRedeclare

        private final boolean isRedeclare
        Whether this declaration is a redeclaration.
      • sClass

        private final SClass sClass
        The class of this effect.
      • name

        private final String name
        The name of this effect which must be unique within the keys of CClass.effects.
      • distr

        private final ProbDistr distr
        An optional probability distribution; otherwise null.
      • form

        private FormulaDecl form
        An optional formula declaration; otherwise null.
    • Method Detail

      • setFormula

        public void setFormula​(FormulaDecl form)
        Sets the given formula form and checks consistency; may throw various exceptions.
        Parameters:
        form - a FormulaDecl which may also be null.
        Throws:
        IllegalArgumentException - if form != null and at the same time
        • this effect is declared as input or
        • this effect has a probability distribution already.
        • the formula is not assignment compatible which currently means the types do not coincide.
      • getSClass

        public SClass getSClass()
      • getName

        public String getName()
      • isInput

        public boolean isInput()
        Returns whether this effect is declared as input.
        Returns:
        whether this effect is declared as input.
      • isOutput

        public boolean isOutput()
        Returns whether this effect is declared as output.
        Returns:
        whether this effect is declared as output.
      • isRedeclare

        public boolean isRedeclare()
        Returns whether this is a redeclaration.
        Returns:
        whether this is a redeclaration.
      • getProbDistr

        ProbDistr getProbDistr()
        Returns the probability distribution if any; otherwise null.
        Returns:
        distr.
      • getFormulaDecl

        FormulaDecl getFormulaDecl()
        Returns the formula if any; otherwise null.
        Returns:
        form.
      • getSInstance

        SInstance getSInstance()
        Returns a effect according to this declaration.
        Returns:
        a effect according to this declaration. This depends on the class, the probability distribution and the name but not on the modifiers and the formula.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object