Class MultiAndExpression
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.expressions.MultiAndExpression
-
public class MultiAndExpression extends Expression
Represents a multi-and expression.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractCallExpression[]expressions
-
Constructor Summary
Constructors Constructor Description MultiAndExpression(AbstractCallExpression... expressions)Creates a multi-and expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IExpressionVisitor visitor)Visits the expression.AbstractCallExpressiongetExpression(int index)Returns the specified expression.intgetExpressionCount()Returns the number of expressions represented by this expression.TypeDescriptor<?>inferType()Infers the type of this expression including the type of the contained sub-expressions.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.Expression
replaceEmptyLine
-
-
-
-
Field Detail
-
expressions
private AbstractCallExpression[] expressions
-
-
Constructor Detail
-
MultiAndExpression
public MultiAndExpression(AbstractCallExpression... expressions) throws VilException
Creates a multi-and expression.- Parameters:
expressions- the individual expressions- Throws:
VilException- ifexpressionsor an expression within is null
-
-
Method Detail
-
getExpressionCount
public int getExpressionCount()
Returns the number of expressions represented by this expression.- Returns:
- the number of expressions
-
getExpression
public AbstractCallExpression getExpression(int index)
Returns the specified expression.- Parameters:
index- the 0-based index- Returns:
- the expression
- Throws:
java.lang.IndexOutOfBoundsException- ifindex<0 || index >=getExpressionCount()
-
inferType
public TypeDescriptor<?> inferType() throws VilException
Description copied from class:ExpressionInfers the type of this expression including the type of the contained sub-expressions.- Specified by:
inferTypein classExpression- Returns:
- the type of this expression
- Throws:
VilException- in case that inferring the type fails
-
accept
public java.lang.Object accept(IExpressionVisitor visitor) throws VilException
Description copied from class:ExpressionVisits the expression.- Specified by:
acceptin classExpression- Parameters:
visitor- the visitor- Returns:
- the result of visiting this expression (may be null)
- Throws:
VilException- in case that visiting fails (e.g., execution)
-
-