Class ContainerOperations
- java.lang.Object
-
- net.ssehub.easy.varModel.cstEvaluation.ContainerOperations
-
public class ContainerOperations extends java.lang.ObjectImplements the default container operations.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classContainerOperations.CalcEvaluatorImplements a container calculation evaluator (just as needed for now).(package private) static interfaceContainerOperations.Container2OperationDefines a container/container operation.(package private) static classContainerOperations.Container2OperationEvaluatorImplements a container/container operation generically.(package private) static classContainerOperations.ContainerArgumentA combined container value / accessor.(package private) static interfaceContainerOperations.ContainerValueOperationDefines a container/value operation.(package private) static classContainerOperations.ContainerValueOperationEvaluatorImplements a container/value operation generically.(package private) static classContainerOperations.FindOperationEvaluatorImplements the "includes"/"excludes" function.(package private) static classContainerOperations.FlattenOperationEvaluatorImplements the "flattens" operation.(package private) static classContainerOperations.IncludesAllOperationEvaluatorImplements the "includesAll"/"excludesAll" function.(package private) static classContainerOperations.IsEmptyOperationEvaluatorImplements the "isEmpty"/"notEmpty" function.(package private) static classContainerOperations.TypeSelectEvaluatorImplements the typeSelection operation.
-
Field Summary
Fields Modifier and Type Field Description (package private) static IOperationEvaluatorADDImplements the "add" operation.(package private) static IOperationEvaluatorAS_SEQUENCEDefines the "asSequence" operation.(package private) static IOperationEvaluatorAS_SETDefines the "asSet" operation.(package private) static IOperationEvaluatorAVGImplements the "avg" operation.(package private) static Pool<ContainerOperations.ContainerArgument>CA_POOL(package private) static IOperationEvaluatorCOUNTImplements the "count" operation.(package private) static IOperationEvaluatorINTERSECTImplements the "intersect" operation generically.(package private) static IOperationEvaluatorMAX(package private) static IOperationEvaluatorMIN(package private) static IOperationEvaluatorSIZEImplementsContainer.SIZE.
-
Constructor Summary
Constructors Modifier Constructor Description privateContainerOperations()Prevent instance creation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static voidaddAll(ContainerOperations.ContainerArgument cnt, java.util.List<Value> result, EvaluationAccessor resAcc)Adds all elements incnttoresult.(package private) static voidaddAll(ContainerOperations.ContainerArgument cnt, java.util.Set<Value> result, EvaluationAccessor resAcc)Adds all elements incnttoresult.private static EvaluationAccessorconvert(EvaluationAccessor operand, IDatatype targetType)Performs the conversion of the operand to the given (container) datatype.(package private) static voidflatten(Value value, java.util.Collection<Value> result)(Recursively) Flattens the given value if needed.(package private) static EvaluationAccessorfound(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean negate)Returns whether the first argument value can be found in theoperandgiven that operand is a container.private static EvaluationAccessormax(EvaluationAccessor operand, EvaluationAccessor[] arguments)Performs the MAX operation the given (container) datatype.private static EvaluationAccessormin(EvaluationAccessor operand, EvaluationAccessor[] arguments)Performs the MIN operation the given (container) datatype.static voidregister()Registers the defined operations.
-
-
-
Field Detail
-
CA_POOL
static final Pool<ContainerOperations.ContainerArgument> CA_POOL
-
SIZE
static final IOperationEvaluator SIZE
ImplementsContainer.SIZE.
-
ADD
static final IOperationEvaluator ADD
Implements the "add" operation.
-
AVG
static final IOperationEvaluator AVG
Implements the "avg" operation.
-
AS_SET
static final IOperationEvaluator AS_SET
Defines the "asSet" operation. Due to the implementation of values in EASy, this operation can be implemented generically.
-
AS_SEQUENCE
static final IOperationEvaluator AS_SEQUENCE
Defines the "asSequence" operation. Due to the implementation of values in EASy, this operation can be implemented generically.
-
MIN
static final IOperationEvaluator MIN
-
MAX
static final IOperationEvaluator MAX
-
INTERSECT
static final IOperationEvaluator INTERSECT
Implements the "intersect" operation generically.
-
COUNT
static final IOperationEvaluator COUNT
Implements the "count" operation.
-
-
Method Detail
-
register
public static void register()
Registers the defined operations.
-
convert
private static final EvaluationAccessor convert(EvaluationAccessor operand, IDatatype targetType)
Performs the conversion of the operand to the given (container) datatype.- Parameters:
operand- the operand to be convertedtargetType- the target datatype- Returns:
- the converted operand
-
min
private static final EvaluationAccessor min(EvaluationAccessor operand, EvaluationAccessor[] arguments)
Performs the MIN operation the given (container) datatype.- Parameters:
operand- the operand to be convertedarguments- the arguments- Returns:
- The result of the arithmetic operation, null if the operation cannot be applied
-
max
private static final EvaluationAccessor max(EvaluationAccessor operand, EvaluationAccessor[] arguments)
Performs the MAX operation the given (container) datatype.- Parameters:
operand- the operand to be convertedarguments- the arguments- Returns:
- The result of the arithmetic operation, null if the operation cannot be applied
-
addAll
static final void addAll(ContainerOperations.ContainerArgument cnt, java.util.List<Value> result, EvaluationAccessor resAcc)
Adds all elements incnttoresult.- Parameters:
cnt- the source of the elementsresult- the target (to be modified as a side effect)resAcc- the accessor tocontfor taking over bound elements
-
addAll
static final void addAll(ContainerOperations.ContainerArgument cnt, java.util.Set<Value> result, EvaluationAccessor resAcc)
Adds all elements incnttoresult.- Parameters:
cnt- the source of the elementsresult- the target (to be modified as a side effect)resAcc- the accessor tocontfor taking over bound elements
-
found
static final EvaluationAccessor found(EvaluationAccessor operand, EvaluationAccessor[] arguments, boolean negate)
Returns whether the first argument value can be found in theoperandgiven that operand is a container.- Parameters:
operand- the operandarguments- the argumentsnegate- negate the result, i.e., from found to not found- Returns:
- whether the first argument was (not) found in
operand
-
-