protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { throw new IllegalStateException(); }
protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { if (type.GetNormalizedClass().IsBigInteger()) { return(streamCountIncoming => new EnumAverageBigIntegerScalarNoParam(streamCountIncoming)); // services.ImportServiceCompileTime.DefaultMathContext } else if (type.GetNormalizedClass().IsDecimal()) { return(streamCountIncoming => new EnumAverageDecimalScalarNoParam( streamCountIncoming)); } else if (type.GetNormalizedClass().IsDouble()) { return(streamCountIncoming => new EnumAverageDoubleScalarNoParam( streamCountIncoming)); } else { throw new ArgumentException("Failed to find a suitable scalar no-param"); } }
protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { return(streamCountIncoming => new EnumArrayOfScalarNoParams(ComponentType(type))); }
protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { return(_ => new EnumCountOfNoParams(_)); }
protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { return(streamCountIncoming => new EnumDistinctOfScalarNoParams(streamCountIncoming, ((ClassMultiValuedEPType)type).Component)); }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar(EnumMethodEnum enumMethod) { return(( lambda, fieldType, numParams, typeInfo, services) => { if (typeInfo.GetNormalizedClass().IsBigInteger()) { return new EnumAverageBigIntegerScalar(lambda, fieldType, numParams); } else if (typeInfo.GetNormalizedClass().IsDecimal()) { return new EnumAverageDecimalScalar(lambda, fieldType, numParams); } else if (typeInfo.GetNormalizedClass().IsDouble()) { return new EnumAverageDoubleScalar(lambda, fieldType, numParams); } else { throw new ArgumentException("Failed to find a suitable scalar"); } }); }
protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { return(streamCountIncoming => new EnumMinMaxScalarNoParam(streamCountIncoming, enumMethod == EnumMethodEnum.MAX, type)); }
public override void Initialize( DotMethodFP footprint, EnumMethodEnum enumMethod, string enumMethodUsedName, EventType inputEventType, Type collectionComponentType, IList<ExprNode> parameters, StreamTypeService streamTypeService, StatementRawInfo statementRawInfo, StatementCompileTimeServices services) { // validate var ctx = new EnumMethodValidateContext( footprint, inputEventType, collectionComponentType, streamTypeService, enumMethod, parameters, statementRawInfo); var enumMethodMode = _forgeFactory.Validate(ctx); if (!(enumMethodMode is EnumMethodModeStaticMethod)) { throw new ExprValidationException("Unexpected EnumMethodMode implementation, expected a provided implementation"); } Mode = (EnumMethodModeStaticMethod) enumMethodMode; }
protected override ThreeFormEventPlainFactory.ForgeFunction SingleParamEventPlain( EnumMethodEnum enumMethod) { return((lambda, typeInfo, services) => enumMethod == EnumMethodEnum.TAKEWHILELAST ? (EnumForge) new EnumTakeWhileLastEvent(lambda) : (EnumForge) new EnumTakeWhileEvent(lambda)); }
public abstract EnumForgeDescFactory GetForgeFactory( DotMethodFP footprint, IList<ExprNode> parameters, EnumMethodEnum enumMethod, string enumMethodUsedName, EventType inputEventType, Type collectionComponentType, ExprValidationContext validationContext);
protected override ThreeFormEventPlusFactory.ForgeFunction SingleParamEventPlus( EnumMethodEnum enumMethod) { return((lambda, fieldType, numParameters, typeInfo, services) => enumMethod == EnumMethodEnum.TAKEWHILELAST ? (EnumForge) new EnumTakeWhileLastEventPlus(lambda, fieldType, numParameters) : (EnumForge) new EnumTakeWhileEventPlus(lambda, fieldType, numParameters)); }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar( EnumMethodEnum enumMethod) { return((lambda, eventType, numParams, typeInfo, services) => enumMethod == EnumMethodEnum.TAKEWHILELAST ? (EnumForge) new EnumTakeWhileLastScalar(lambda, eventType, numParams) : (EnumForge) new EnumTakeWhileScalar(lambda, eventType, numParams)); }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar(EnumMethodEnum enumMethod) { return(( lambda, fieldType, numParams, typeInfo, services) => new EnumArrayOfScalar(lambda, fieldType, numParams, ComponentType(typeInfo))); }
public EnumForgeDescFactoryEIU( EnumMethodEnum enumMethod, EPType type, ExprDotEnumerationSourceForge enumSrc) { _enumMethod = enumMethod; _type = type; _enumSrc = enumSrc; }
public EnumForgeDescFactoryTake( EnumMethodEnum enumMethod, EPType type, bool isScalar) { _enumMethod = enumMethod; _type = type; _isScalar = isScalar; }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar(EnumMethodEnum enumMethod) { return(( lambda, fieldType, numParams, typeInfo, services) => new EnumWhereScalar(lambda, fieldType, numParams)); }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar(EnumMethodEnum enumMethod) { return(( lambda, fieldType, numParams, typeInfo, services) => new EnumAllOfAnyOfScalar(lambda, fieldType, numParams, enumMethod == EnumMethodEnum.ALLOF)); }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar(EnumMethodEnum enumMethod) { return(( lambda, eventType, numParams, typeInfo, services) => new EnumMinMaxScalar(lambda, eventType, numParams, enumMethod == EnumMethodEnum.MAX)); }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar(EnumMethodEnum enumMethod) { return(( lambda, eventType, numParams, typeInfo, services) => new EnumMostLeastFrequentScalar(lambda, eventType, numParams, enumMethod == EnumMethodEnum.MOSTFREQUENT)); }
protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { return(streamCountIncoming => new EnumMostLeastFrequentScalarNoParam( streamCountIncoming, enumMethod == EnumMethodEnum.MOSTFREQUENT, type.GetNormalizedClass())); }
public override EnumForgeDescFactory GetForgeFactory( DotMethodFP footprint, IList<ExprNode> parameters, EnumMethodEnum enumMethod, String enumMethodUsedName, EventType inputEventType, Type collectionComponentType, ExprValidationContext validationContext) { return new EnumForgeDescFactorySeqEqual(inputEventType == null); }
public EnumMethodDesc( string methodName, EnumMethodEnum enumMethod, ExprDotForgeEnumMethodFactory factory, DotMethodFP[] parameters) { _enumMethodName = methodName; _enumMethod = enumMethod; _factory = factory; _parameters = parameters; }
public virtual void Initialize( DotMethodFP footprint, EnumMethodEnum enumMethod, string enumMethodUsedName, EventType inputEventType, Type collectionComponentType, IList<ExprNode> parameters, StreamTypeService streamTypeService, StatementRawInfo statementRawInfo, StatementCompileTimeServices services) { // override as required }
protected override ThreeFormNoParamFactory.ForgeFunction NoParamsForge( EnumMethodEnum enumMethod, EPType type, StatementCompileTimeServices services) { if (enumMethod == EnumMethodEnum.FIRSTOF) { return(streamCountIncoming => new EnumFirstOf(streamCountIncoming, type)); } else { return(streamCountIncoming => new EnumLastOf(streamCountIncoming, type)); } }
/// <summary> /// Ctor. /// </summary> /// <param name="footprintFound">actual footprint chosen</param> /// <param name="inputEventType">input event type or null if the input is not a collection of events</param> /// <param name="inputCollectionComponentType">type of scalar or object (non-event) input values, or null if the input is a collection of events</param> /// <param name="streamTypeService">event type information</param> /// <param name="currentMethod">information on the current method</param> /// <param name="currentParameters">parameters</param> /// <param name="statementRawInfo">EPL statement information</param> public EnumMethodValidateContext( DotMethodFP footprintFound, EventType inputEventType, Type inputCollectionComponentType, StreamTypeService streamTypeService, EnumMethodEnum currentMethod, IList<ExprNode> currentParameters, StatementRawInfo statementRawInfo) { FootprintFound = footprintFound; InputEventType = inputEventType; InputCollectionComponentType = inputCollectionComponentType; StreamTypeService = streamTypeService; CurrentMethod = currentMethod; CurrentParameters = currentParameters; StatementRawInfo = statementRawInfo; }
public override EnumForgeDescFactory GetForgeFactory( DotMethodFP footprint, IList<ExprNode> parameters, EnumMethodEnum enumMethod, String enumMethodUsedName, EventType inputEventType, Type collectionComponentType, ExprValidationContext validationContext) { EPType type; if (inputEventType != null) { type = EPTypeHelper.CollectionOfEvents(inputEventType); } else { type = EPTypeHelper.CollectionOfSingleValue(collectionComponentType, null); } return new EnumForgeDescFactoryTake(enumMethod, type, inputEventType == null); }
public override EnumForgeDescFactory GetForgeFactory( DotMethodFP footprint, IList <ExprNode> parameters, EnumMethodEnum enumMethod, string enumMethodUsedName, EventType inputEventType, Type collectionComponentType, ExprValidationContext validationContext) { var goesNode = (ExprLambdaGoesNode)parameters[1]; var numParameters = goesNode.GoesToNames.Count; var firstName = goesNode.GoesToNames[0]; var secondName = goesNode.GoesToNames[1]; IDictionary <string, object> fields = new Dictionary <string, object>(); var initializationType = parameters[0].Forge.EvaluationType; fields.Put(firstName, initializationType); if (inputEventType == null) { fields.Put(secondName, collectionComponentType); } if (numParameters > 2) { fields.Put(goesNode.GoesToNames[2], typeof(int)); if (numParameters > 3) { fields.Put(goesNode.GoesToNames[3], typeof(int)); } } var evalEventType = ExprDotNodeUtility.MakeTransientOAType( enumMethodUsedName, fields, validationContext.StatementRawInfo, validationContext.StatementCompileTimeService); if (inputEventType == null) { return(new EnumForgeDescFactoryAggregateScalar(evalEventType)); } return(new EnumForgeDescFactoryAggregateEvent(evalEventType, inputEventType, secondName, numParameters)); }
protected override ThreeFormScalarFactory.ForgeFunction SingleParamScalar(EnumMethodEnum enumMethod) { return(( lambda, eventType, numParams, typeInfo, services) => { if (enumMethod == EnumMethodEnum.FIRSTOF) { return new EnumFirstOfScalar(lambda, eventType, numParams, typeInfo); } else { return new EnumLastOfScalar(lambda, eventType, numParams, typeInfo); } }); }
public override EnumForgeDescFactory GetForgeFactory( DotMethodFP footprint, IList<ExprNode> parameters, EnumMethodEnum enumMethod, string enumMethodUsedName, EventType inputEventType, Type collectionComponentType, ExprValidationContext validationContext) { return new ProxyEnumForgeDescFactory() { ProcGetLambdaStreamTypesForParameter = parameterNum => new EnumForgeLambdaDesc(new EventType[0], new String[0]), ProcMakeEnumForgeDesc = ( bodiesAndParameters, streamCountIncoming, services) => { var type = EPTypeHelper.CollectionOfEvents(inputEventType); return new EnumForgeDesc(type, new EnumForgeNoOp(streamCountIncoming)); } }; }
public override EnumForgeDescFactory GetForgeFactory( DotMethodFP footprint, IList<ExprNode> parameters, EnumMethodEnum enumMethod, string enumMethodUsedName, EventType inputEventType, Type collectionComponentType, ExprValidationContext validationContext) { if (Mode == null) { throw new IllegalStateException("Initialize did not take place"); } return new EnumForgeDescFactoryPlugin( Mode, enumMethodUsedName, footprint, parameters, inputEventType, collectionComponentType, validationContext.StatementRawInfo, validationContext.StatementCompileTimeService); }