Class ContainerInitializer

  • All Implemented Interfaces:
    IAttributeAccess

    public class ContainerInitializer
    extends ConstraintSyntaxTree
    Represents an initializer for containers. This initializer may contain expressions for initializing container entries. IVML: {expression, ...}. We need a special constraint tree node for this purpose as values form net.ssehub.easy.varModel.model.values are intended to be constants and, thus, cannot contain arbitrary expressions.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ContainerInitializer

        public ContainerInitializer​(Container type,
                                    ConstraintSyntaxTree[] expressions)
                             throws CSTSemanticException
        Creates a new container initializer.
        Parameters:
        type - the type of the compound
        expressions - the initializing expressions (in sequence for containers which support sequences)
        Throws:
        CSTSemanticException - in case that the initialization fails, element type mismatch
    • Method Detail

      • getType

        public Container getType()
        Returns the type of the container.
        Returns:
        the type of the container
      • getExpressionCount

        public int getExpressionCount()
        Returns the number of expressions.
        Returns:
        the number of expressions
      • getExpression

        public ConstraintSyntaxTree getExpression​(int index)
        Returns the specified expression.
        Parameters:
        index - the index of the expression to be returned
        Returns:
        the specified expression
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >=getExpressionCount()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object